histogram plots color range

Hello ,

I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows themselves hold values of the bins of a distribution (which is not always normal, can expect a bimodal curve as well)

It is little difficult to explain to I actually created a sample figure:

http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream

Any help or trick will be very useful

loads of thanks

nahren

This plot seems similar to something I wanted to do (and asked the list about). I ended up getting something to work, but the code is a bit ugly. I’ve attached my most recent version (which probably needs some cleaning up, but it works).

If you want a continuous field instead of distinct bars (like you have in your sample image), you may be able to write up something that’s a little simpler by sectioning out the columns an array into strips of equal width and repeating histogram values across those columns (sorry, this is a bit vague). Then use imshow to plot the array.

-Tony

histstrip.py (3.17 KB)

···

On Fri, Jan 27, 2012 at 11:27 AM, nahren manuel <meetnahren@…9…> wrote:

Hello ,

I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows themselves hold values of the bins of a distribution (which is not always normal, can expect a bimodal curve as well)

It is little difficult to explain to I actually created a sample figure:

http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream

Any help or trick will be very useful

loads of thanks

nahren

Hello ,
I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows
themselves hold values of the bins of a distribution (which is not always
normal, can expect a bimodal curve as well)
It is little difficult to explain to I actually created a sample figure:
fig | Nahren Mascarenhas | Flickr

Any help or trick will be very useful

loads of thanks

nahren

This plot seems similar to something I wanted to do (and asked the list
about). I ended up getting something to work, but the code is a bit ugly.
I've attached my most recent version (which probably needs some cleaning up,
but it works).

If you want a continuous field instead of distinct bars (like you have in
your sample image), you may be able to write up something that's a little
simpler by sectioning out the columns an array into strips of equal width
and repeating histogram values across those columns (sorry, this is a bit
vague). Then use `imshow` to plot the array.

Looks nice.

Given that it is too specialized for matplotlib, it would be an
interesting addition to violin and bean plots in scikits.statsmodels
if you don't mind that we borrow it (scikits.statsmodels is BSD
licensed).

Thanks,

Josef

···

On Fri, Jan 27, 2012 at 12:18 PM, Tony Yu <tsyu80@...287...> wrote:

On Fri, Jan 27, 2012 at 11:27 AM, nahren manuel <meetnahren@...9...> > wrote:

-Tony

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Sure thing—I’m happy to contribute. The code probably needs to be cleaned up, but unfortunately, I have little motivation since I don’t use it anymore. Feel free to do whatever you like with it.

Cheers,
-Tony

···

On Fri, Jan 27, 2012 at 4:01 PM, <josef.pktd@…1896…> wrote:

On Fri, Jan 27, 2012 at 12:18 PM, Tony Yu <tsyu80@…287…> wrote:

On Fri, Jan 27, 2012 at 11:27 AM, nahren manuel <meetnahren@…9…> > > > wrote:

Hello ,

I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows

themselves hold values of the bins of a distribution (which is not always

normal, can expect a bimodal curve as well)

It is little difficult to explain to I actually created a sample figure:

http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream

Any help or trick will be very useful

loads of thanks

nahren

This plot seems similar to something I wanted to do (and asked the list

about). I ended up getting something to work, but the code is a bit ugly.

I’ve attached my most recent version (which probably needs some cleaning up,

but it works).

If you want a continuous field instead of distinct bars (like you have in

your sample image), you may be able to write up something that’s a little

simpler by sectioning out the columns an array into strips of equal width

and repeating histogram values across those columns (sorry, this is a bit

vague). Then use imshow to plot the array.

Looks nice.

Given that it is too specialized for matplotlib, it would be an

interesting addition to violin and bean plots in scikits.statsmodels

if you don’t mind that we borrow it (scikits.statsmodels is BSD

licensed).

Thanks,

Josef

nahren manuel wrote:

Hello ,
I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows
themselves hold values of the bins of a distribution (which is not always
normal, can expect a bimodal curve as well)

It is little difficult to explain to I actually created a sample figure:

fig | Nahren Mascarenhas | Flickr

Any help or trick will be very useful
loads of thanks

nahren

I took some of the code that I use regularly and came up with this minimal
example of fitting data very similar to the figure you showed above. I hope
the explanations in the code are clear enough.

link to my website with code example

Here is the code and the output figure. Hope this helps someone!
Johann.

http://old.nabble.com/file/p33231288/y_profile.py y_profile.py
http://old.nabble.com/file/p33231288/y_profile.png

···

--
View this message in context: http://old.nabble.com/histogram-plots-color-range-tp33215265p33231288.html
Sent from the matplotlib - users mailing list archive at Nabble.com.