Fixing color in scatter plots in matplotlib

Posted by ajhall on Stack Overflow See other posts from Stack Overflow or by ajhall
Published on 2010-05-27T23:50:02Z Indexed on 2010/05/27 23:51 UTC
Read the original article Hit count: 311

Filed under:
|
|
|

Hi guys, I'm going to have to come back and add some examples if you need them, which you might. But, here's the skinny- I'm plotting scatter plots of lab data for my research. I need to be able to visually compare the scatter plots from one plot to the next, so I want to fix the color range on the scatter plots and add in a colorbar to each plot (which will be the same in each figure). Essentially, I'm fixing all aspects of the axes and colorspace etc. so that the plots are directly comparable by eye.

For the life of me, I can't seem to get my scatter() command to properly set the color limits in the colorspace (default)... i.e., I figure out my total data's min and total data's max, then apply them to vmin, vmax, for the subset of data, and the color still does not come out properly in both plots.

This must come up here and there, I can't be the only one that wants to compare various subsets of data amongst plots... so, how do you fix the colors so that each data keeps it's color between plots and doesn't get remapped to a different color due to the change in max/min of the subset -v- the whole set?

I greatly appreciate all your thoughts!!!

A mountain-dew and fiery-hot cheetos to all! -Allen

© Stack Overflow or respective owner

Related posts about python

Related posts about color