facecolor kwarg for Matplotlib stacked histogram
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having trouble controlling the color and linestyle of histogram plotted using Matplotlib's hist function with stacked=True . For a single non-stacked histogram, I have no trouble: import pylab as P mu, sigma = 200, 25 x0 = mu + sigma*P.randn(10000) n, bins, patches = P.hist( x0, 20, histtype='stepfilled', facecolor='lightblue' ) However, when I introduce additional histograms, import pylab as P mu, sigma = 200, 25 x0 = mu + sigma*P.randn(10000) x1 = mu + sigma*P.randn(7000) x2 = mu + sigma*P.randn(3000) n, bins, patches = P.hist( [x0,x1