I'd like to be able to create and use a custom colormap.  I'm creating the
colormap via
the following statement:

matplotlib.colors.ListedColormap([(0,0,0),(0.6,0,0),(0,0.6,0),(0.6,0.6,0)],
  name='Earth')

The above statement appears to work, but when I attempt to use this
colormap, I
get the error shown below.  Any suggestions will be appreciated.

AssertionError                            Traceback (most recent call last)

art.py in <module>()
    253
    254 # Plot z as image using specified color map:
--> 255 pyplot.imshow(z, origin='lower', cmap=get_cmap(map_names[n_map-1]),
    256   extent=[x.min(),x.max(),y.min(),y.max()])
    257

C:\Program
Files\Python25\lib\site-packages\matplotlib-0.98.5.2n2-py2.5-win32.egg\matplotlib\cm.pyc
in get_cmap(name, lut)
     19     if lut is None: lut = mpl.rcParams['image.lut']
     20
---> 21     assert(name in datad.keys())
     22     return colors.LinearSegmentedColormap(name,  datad[name], lut)
     23

AssertionError:
-- 
View this message in context: 
http://www.nabble.com/can%27t-use-custom-color-maps-tp25629072p25629072.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to