Dear Don,
    Thanks for the comment, the set type is no problem for me, this is just
a variable that I call set... and it works great for my purposes, I do
suspect it is something in the way that matplotlib/pyplot deals with
histograms, but I have not so far been able to find the right syntax.
 Note, the first code example works great, it is only the second (with the
hist attempt) that does not do well.  It creates 29 blank plots and 1
histogram instead of 30 histograms... so probably it does need a different
phrasing, but the one you suggest gives invalid syntax.
~Elaina

On Tue, Jun 26, 2012 at 9:19 PM, Don Jennings <dfjenni...@gmail.com> wrote:

> > Message: 1
> > Date: Tue, 26 Jun 2012 18:40:50 +1000
> > From: Elaina Ann Hyde <elainah...@gmail.com>
> > To: tutor@python.org
> > Subject: [Tutor] Looping over histogram plots
>
> <snip>
>
> >        set=(dat['a'+str(index)] == 1.00)
>
> You should not override the builtin set() type [1] as you've done here by
> assigning it.
>
> > #write the data
> >        P.hist(VGSR[set],bins=30, normed=True)
>
> I am not familiar with matplotlib, etc. but given that the primary
> difference in your two code samples is where you write the data, I suspect
> you want something like:
>
>        ax.plot(P.hist(VGSR[set],bins=30, normed=True))
>
> Take care,
> Don
>
> [1] http://docs.python.org/library/stdtypes.html#set




-- 
PhD Candidate
Department of Physics and Astronomy
Faculty of Science
Macquarie University
North Ryde, NSW 2109, Australia
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to