Relative Content

Tag Archive for pythonmatplotlibbar-chartstacked-bar-chart

Editing specific labels in stacked bar chart with matplotlib

I am following this tutorial/example to create stacked bar charts, however in my case I am representing various types of support tickets that are being received by specific technicians. As such, not all of the types are always present, so some of the bar values are zero and not all of the totals for each row add up to the same amount. I am trying to find a way to edit the labels such that they are either transparent or are simply not applied if a given bar width is zero, as right now there is a ‘0’ label appearing between other categories. I am able to access the widths via something like the following:

Editing specific labels in stacked bar chart with matplotlib

I am following this tutorial/example to create stacked bar charts, however in my case I am representing various types of support tickets that are being received by specific technicians. As such, not all of the types are always present, so some of the bar values are zero and not all of the totals for each row add up to the same amount. I am trying to find a way to edit the labels such that they are either transparent or are simply not applied if a given bar width is zero, as right now there is a ‘0’ label appearing between other categories. I am able to access the widths via something like the following: