hi all,
i am trying to make a simple stacked bar graphs (just two layers) and
am getting some strange results. i have the following code:
import numpy as np
import matplotlib.pyplot as plt
ind = np.arange(3)
width = 0.35
plt.bar(ind, [5128307, 4305252, 4817425], width, align='center', color='r')
plt.bar(ind, [5969352, 5011032, 5590754], width, align='center',
bottom=[5128307, 4305252, 4817425], color='k')
i want it to be so that the bar graphs with values [5128307, 4305252,
4817425] appear in red "below" the taller bar graphs with values
[5969352, 5011032, 5590754]. when i try to plot this, i get a very
strange y-axis, formatted on a 1e7 scales, and the values appear
wrong.
if i modify my plot to simply be:
ind = np.arange(3)
width = 0.35
plt.bar(ind, [5969352, 5011032, 5590754], width, align='center', color='k')
then the y-axis appears correctly, with ylim set to 6 million. how can
i get the graph to look just like this, except have the stacked
smaller bar graphs appear in red?
any help on this would be greatly appreciated.
thanks.