What is a good converging color map for matplotlib

When creating scatterplots, there are many variations of diverging color maps that emphasize data at extremes, but there are no variations of a converging color map that emphasizes data near the middle of the range. Can someone suggest one or tell me why it is a bad idea to use it?

My use case is a scatter plot, where each dot represents a fit to a different dataset, and the color represents a reduced square fit. I want to emphasize values ​​close to one and de-emphasize bad fits.

Edit

Here is my usage example in more detail. I measure the performance of an algorithm designed to distinguish between real and systematic signals in time-series data (in this case, the planet goes into Kepler's data compared to glitches in the data). For each simulation, I have an input value, a number that describes the solution to the algorithm, and a reduced chi square that measures the quality factor of the match. I want to use the color scheme to highlight the points that reduced the chi squares closest to one, and not those cases where the match is bad.

There are many ways to do this (for example, with dot size), but I would like to do this with color if I can.

+7
python matplotlib colors
source share
1 answer

A simple approach is to change the standard color map. There's a scipy cookbook page on how to do a colormap conversion, and enter image description here

inv = cmap_map(lambda x: 1-x, cm.PRGn) # the "transformation" = 1-x # plot the original or modified for comparison x,y=mgrid[1:2,1:10:0.1] plt.imshow(y, cmap=cm.PRGn) plt.title("original") plt.figure() plt.imshow(y, cmap=inv) plt.title("inverted") plt.show() 
+5
source share

All Articles