

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Plot multiple columns of Pandas DataFrame using Seaborn
To plot multiple columns of Pandas DataFrame using Seaborn, we can take the following steps −
Make a dataframe using Pandas.
Plot a bar using Seaborn's barplot() method.
Rotate the xticks label by 45 angle.
To display the figure, use show() method.
Example
import pandas import matplotlib.pylab as plt import seaborn as sns import numpy as np plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True df = pandas.DataFrame({"X-Axis": [np.random.randint(10) for i in range(10)], "YAxis": [i for i in range(10)]}) bar_plot = sns.barplot(x='X-Axis', y='Y-Axis', data=df) plt.xticks(rotation=45) plt.show()
Output
- Related Questions & Answers
- Python Pandas - Plot multiple data columns in a DataFrame?
- Plot multiple columns of Pandas dataframe on the bar chart in Matplotlib
- Select multiple columns in a Pandas DataFrame
- How to sort multiple columns of a Pandas DataFrame?
- Python - Select multiple columns from a Pandas dataframe
- How to plot multiple histograms on same plot with Seaborn using Matplotlib?
- Frequency plot in Python/Pandas DataFrame using Matplotlib
- Python - Renaming the columns of Pandas DataFrame
- How to plot multiple Seaborn Jointplot in Subplot using Matplotlib?
- How to plot certain rows of a Pandas dataframe using Matplotlib?
- Python Pandas - Query the columns of a DataFrame
- Python - Grouping columns in Pandas Dataframe
- How to select multiple DataFrame columns using regexp and datatypes
- Python - Create a Time Series Plot with multiple columns using Line Plot
- Plot a lineplot with Seaborn – Python Pandas
Advertisements