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

WDyk@nobleenergyin... WDyk@nobleenergyin...
Mon Aug 22 14:23:03 CDT 2011


In ipython 0.11, use Ctrl-Enter to enter multi-line edit mode.  You can 
then send multiple commands to change your plot.  Hit Enter on a blank 
line to send all commands at once.

Wes Dyk, Production Systems Admin
Noble Energy, Inc.



From:   scipy-user-request@scipy.org
To:     scipy-user@scipy.org
Date:   08/21/2011 11:00 AM
Subject:        SciPy-User Digest, Vol 96, Issue 31
Sent by:        scipy-user-bounces@scipy.org



Message: 1
Date: Sat, 20 Aug 2011 16:12:22 -0700
From: Chris Withers <chris@simplistix.co.uk>
Subject: [SciPy-User] IPython inline plots of stacked bars graphs
To: SciPy Users List <scipy-user@scipy.org>
Message-ID: <4E503F56.1090908@simplistix.co.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

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,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk


------------------------------

Message: 2
Date: Sat, 20 Aug 2011 17:46:37 -0600
From: Charles R Harris <charlesr.harris@gmail.com>
Subject: Re: [SciPy-User] IPython inline plots of stacked bars graphs
To: SciPy Users List <scipy-user@scipy.org>
Message-ID:
 <CAB6mnxLD9Fi59Dmoq0yUNw5o+sGrUUq3JzrTjjajqY=cJ-5Pgw@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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


------------------------------

_______________________________________________
SciPy-User mailing list
SciPy-User@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user


End of SciPy-User Digest, Vol 96, Issue 31
******************************************




The information contained in this e-mail and any attachments may be confidential. If you are not the intended recipient, please understand that dissemination, copying, or using such information is prohibited. If you have received this e-mail in error, please immediately advise the sender by reply e-mail and delete this e-mail and its attachments from your system.


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


More information about the SciPy-User mailing list