Goyo,

Aha, so I can call .set_facecolor() on the Patch objects, and then force the
graph to re-draw().

I've tested it - it works when I do savefig(). And if I'm running it
interactive, I just run matplotlib.draw() after modifying the patch list.

I suppose I can combine that technique with the calculation tip from Ben to
colour-code the different region.

I could run a for-loop over the Patch list, and do multiple if's - however,
wondering if there's a way to do it with a list-comprehension?

Thanks for the tips, guys =).

Cheers,
Victor

On Fri, Feb 25, 2011 at 10:02, Goyo <goyod...@gmail.com> wrote:

> 2011/2/22 Benjamin Root <ben.r...@ou.edu>:
> >
> > Admittedly, this isn't using matplotlib's hist() function because it only
> > allows for one color per dataset.  However, you can use numpy's histogram
> > function to get the bins and counts yourself, and then use bar() to make
> the
> > bars.  bar() will allow you to color the bars individually.
>
> Pylab hist() returns a list of patches so you can also change their
> properties.
>
> Goyo
>
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to