Since you are using pandas, it’s worth mentioning that you can do stacked bar plots natively:
df2.plot(kind='bar', stacked=True)
See the visualisation section of the docs.
More Related Contents:
- Scatter plots in Pandas/Pyplot: How to plot by category [duplicate]
- Stacked Bar Chart with Centered Labels
- Pandas timeseries plot setting x-axis major and minor ticks and labels
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- Pandas – Plotting a stacked Bar Chart
- Improve subplot size/spacing with many subplots in matplotlib
- Seaborn Barplot – Displaying Values
- How to give a pandas/matplotlib bar graph custom colors
- Plot Pandas DataFrame as Bar and Line on the same one chart
- Horizontal stacked bar plot and add labels to each section
- How to invert the x or y axis
- How to change the datetime tick label frequency for matplotlib plots
- Matplotlib DateFormatter for axis label not working
- How to plot multi-color line if x-axis is date time index of pandas
- How to save a Seaborn plot into a file
- Background with range on seaborn based on two columns
- How to plot different groups of data from a dataframe into a single figure
- Can Pandas plot a histogram of dates?
- Seaborn Bar Plot Ordering
- Matplotlib showing x-tick labels overlapping
- Xticks by pandas plot, rename with the string
- matplotlib savefig() size control
- How to automatically annotate maximum value in pyplot
- Python making combined bar and line plot with secondary y-axis
- How to annotate grouped bar plot with percent by hue/legend group
- Discrete legend in seaborn heatmap plot
- seaborn heatmap using pandas dataframe
- Sorted bar charts with pandas/matplotlib or seaborn
- Color a scatter plot by Column Values
- Is it possible to add a string as a legend item