VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-create-stacked-bar-chart-in-python-plotly/

⇱ How to create Stacked bar chart in Python-Plotly? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to create Stacked bar chart in Python-Plotly?

Last Updated : 29 Oct, 2020

Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.

Stack bar chart

A stacked bar chart or  graph is a chart that uses bars to demonstrate comparisons between categories of data, but with ability to impart and compare parts of a whole. Each bar in the chart represents a whole and segments which represent different parts or categories of that whole.

Example 1: Using iris dataset

 
 

Output:


 

👁 Image


 

Example 2: Using tips dataset


 

 
 

Output:


 

👁 Image


 

Example 3: Using graph_objects class


 

 
 

Output:


 

👁 Image


 

Comment
Article Tags:
Article Tags: