I asked same question with different problem here:
http://matplotlib.1069221.n5.nabble.com/How-to-shift-colormap-td18451.html

You can see there how to use Gimp and create mpl colormap and then later
there is nifty code that will allow you to shift colormaps with a slider

>From your problem I assume you would want the first.

Here is ready made for you:

========================================
import matplotlib as mpl
import matplotlib.pyplot as plt

ccm = {
'red' : (
(0.000000, 0.000000, 0.000000),
(0.000001, 1.000000, 1.000000),
(0.500000, 0.500000, 0.500000),
(1.000000, 0.000000, 0.000000)
),
'green' : (
(0.000000, 0.000000, 0.000000),
(0.000001, 1.000000, 1.000000),
(0.500000, 0.500000, 0.500000),
(1.000000, 0.000000, 0.000000)
),
'blue' : (
(0.000000, 0.000000, 0.000000),
(0.000001, 1.000000, 1.000000),
(0.500000, 0.500000, 0.500000),
(1.000000, 0.000000, 0.000000)
)
}

cm = mpl.colors.LinearSegmentedColormap('my_map', ccm)

from numpy import outer, arange, ones
a = outer(arange(0, 1, 0.01), ones(10))

plt.imshow(a, cmap=cm)
plt.show()
========================================
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to