[SciPy-User] IPython inline plots of stacked bars graphs

Charles R Harris charlesr.harris@gmail....
Sat Aug 20 18:46:37 CDT 2011


On Sat, Aug 20, 2011 at 5:12 PM, Chris Withers <chris@simplistix.co.uk>wrote:

> Hi All,
>
> If I do the following in an IPython 0.11 Qt shell:
>
> import matplotlib.pyplot as plt
> menMeans   = (20, 35, 30, 35, 27)
> womenMeans = (25, 32, 34, 20, 25)
> plt.bar(ind, menMeans, color='r')
> plt.bar(ind, womenMeans, color='y', bottom=menMeans)
>
> I get, as I'd expect, a stacked bar graph.
>
> However, if I do:
>
> plt.bar(ind, menMeans, color='r')
>
> ...hit enter, and then do:
>
> plt.bar(ind, womenMeans, color='y', bottom=menMeans)
>
> ...I get two separate plots.
>
> How can I add to an existing inline plot?
>
> Also, and I guess this might be more of a matplotlib question, how do I
> "reach inside" an existing plot to, for example, adjust the width of the
> bars used?
>
> cheers,
>
>
I think it is more of an ipython question, possibly a matplotlib question ;)
You might try the hold(True) command.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110820/ddeadad1/attachment.html 


More information about the SciPy-User mailing list