
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python Pandas - Plot a Grouped Horizontal Bar Chart will all the columns
For a grouped Horizontal Bar Chart with all the columns, create a Bar Chart using the barh() and do not set the a and y values.
At first, import the required libraries −
import pandas as pd import matplotlib.pyplot as plt
Create a DataFrame with 3 columns −
dataFrame = pd.DataFrame({"Car": ['Bentley', 'Lexus', 'BMW', 'Mustang', 'Mercedes', 'Jaguar'],"Cubic_Capacity": [2000, 1800, 1500, 2500, 2200, 3000],"Reg_Price": [7000, 1500, 5000, 8000, 9000, 6000], })
Plotting grouped Horizontal Bar Chart with all the columns −
dataFrame.plot.barh(title='Car Specifications', color=("blue", "orange"))
Example
Following is the complete code −
import pandas as pd import matplotlib.pyplot as plt # creating dataframe dataFrame = pd.DataFrame({"Car": ['Bentley', 'Lexus', 'BMW', 'Mustang', 'Mercedes', 'Jaguar'],"Cubic_Capacity": [2000, 1800, 1500, 2500, 2200, 3000],"Reg_Price": [7000, 1500, 5000, 8000, 9000, 6000], }) # plotting grouped Horizontal Bar Chart with all the columns dataFrame.plot.barh(title='Car Specifications', color=("blue", "orange")) # display the plotted Horizontal Bar Chart plt.show()
Output
This will produce the following output −
- Related Articles
- Python Pandas - Plot a Stacked Horizontal Bar Chart
- Python Pandas - Create a Horizontal Bar Chart
- Plot multiple columns of Pandas dataframe on the bar chart in Matplotlib
- Create bar plot for grouped data of two columns in base R.
- Horizontal stacked bar chart in Matplotlib
- Create a Bar plot with SeaBorn – Python Pandas
- Plot the dataset to display Horizontal Trend – Python Pandas
- How to plot a bar chart for a list in Python matplotlib?
- Python Pandas - Draw a set of horizontal bar plots with Seaborn
- Python - Plot a Pie Chart for Pandas Dataframe with Matplotlib?
- Python Pandas - Plot multiple data columns in a DataFrame?
- Python - How to plot a Pandas DataFrame in a Bar Graph
- Python Pandas - Create a Bar Plot and style the bars in Seaborn
- Plot two horizontal bar charts sharing the same Y-axis in Python Matplotlib
- Python Pandas - Draw a set of vertical bar plots grouped by a categorical variable with Seaborn

Advertisements