stacked-chart

How to create stacked bar chart in python, color coded by category

How to create stacked bar chart in python, color coded by category Question: I’m working on a popular Titanic dataset on Kaggle, and I would like to create a bar chart showing the numbers of survivors vs. deceased by gender. On the x-axis, I want gender (male/female). I want to have the survivors and deceased …

Total answers: 3

How to calculate percent by row and annotate 100 percent stacked bars

How to calculate percent by row and annotate 100 percent stacked bars Question: I need help adding the percent distribution of the total (no decimals) in each section of a stacked bar plot in pandas created from a crosstab in a dataframe. Here is sample data: data = { ‘Name’:[‘Alisa’,’Bobby’,’Bobby’,’Alisa’,’Bobby’,’Alisa’, ‘Alisa’,’Bobby’,’Bobby’,’Alisa’,’Bobby’,’Alisa’], ‘Exam’:[‘Semester 1′,’Semester 1′,’Semester 1’,’Semester …

Total answers: 2

Using a Custom Color Palette in Stacked Bar Chart

Using a Custom Color Palette in Stacked Bar Chart Question: So am trying to create a stacked bar chart where all of the slices of the chart will remain constant throughout the program, but I cannot figure out how to get df.plot to use a custom palette. I want to make sure that if I …

Total answers: 2