[yt-users] eps writer with custom colormap

Geoffrey So gsiisg at gmail.com
Sat Sep 29 16:36:49 PDT 2012


Hi, this question is mainly for John Wise,

While attempting to produce different plots for a paper, I wanted to create
color and gray scale versions of the same plot, but since the background of
most plots are white, a gray scale for 2D phase plot would either show the
highest or lowest color as white and blend in with the background, so I
made my own gray scale colormap according to the matplotlib manual.

It works great for PlotCollection and I can make
color/gray-scale-with-no-white-data images in png, but when I tried to use
the same colormap with the eps writer, it complains about it in line 571 in
yt/visualization/eps_writer.py

Here's a sample script of what I used to generate my plots
http://paste.yt-project.org/show/2739/

If I change the line 62 of the script from

p.set_cmap(my_gray_cmap)

to:

p.set_cmap('jet')

the error goes away.  So PyX can take the matplotlib colormaps or have
the same ones built-in.  Is there a convenient way to get

_cmap = plot.cmap.name

to recognize custom colormaps?  Or is there an easier solution to my
problem of displaying gray scale data without using the white portion of
the gray scale colorbar?

Thanks in advance

From
G.S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120929/c07e185a/attachment.htm>


More information about the yt-users mailing list