[yt-users] Setting Color map and x and y axis ticks in PlotCollection or ProjectionPlot

Britton Smith brittonsmith at gmail.com
Wed Nov 6 06:02:34 PST 2013


Hi Kearn,

You can solve this with your first approach by doing:
prj.set_cmap('Density', ‘YlOrRd’)

The reason for this is that ProjectionPlot allows you to project more than
one field at a time and so this functionality lets you set the colormap for
each projection individually.

We are currently in the process of phasing out the PlotCollection, so I
would discourage you from using the second approach.

Britton


On Wed, Nov 6, 2013 at 12:32 PM, <k.grisdale at surrey.ac.uk> wrote:

> Hi Everyone,
>
> I am trying to plot 3D data from RAMSES as a projection. The plots I have
> created with the ProjectionPlot look good (with the command below) but I
> want to rescale the colour map so that when I compare different times the
> scale matches. I would also like to change colour map used.
>
> [ProjectionPlot(p6,'z','Density',center=[0.5,0.5,0.5]).save(“p6”)]
>
> I started by trying to change just the colour map on these plots using the
> following:
>
> prj=ProjectionPlot(p6,'z','Density',center=[0.5,0.5,0.5]).save(“p6”)
> prj.set_cmap(‘YlOrRd’)
>
> but I get the error:
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/Applications/Code/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
> line 107, in newfunc
>     rv = f(*args, **kwargs)
>
> and I’m not sure what I am missing.
>
> I have now tried a different approach of
>
> cen = [0.5,0.5,0.5]
> pc = PlotCollection(p6, cen)
> pc.add_projection("Density",2)
> pc.set_width(0.5, 'cm')
> pc.set_xlim(-0.35, 0.35)
> pc.set_ylim(-0.35, 0.35)
> pc.set_zlim(0.06, 0.22)
> pc.set_cmap('YlOrRd')
> pc.save('test’)
>
> While this new approach changes the colour map on the image it does update
> the colour map on the colour bar(not sure if thats the correct name) on the
> left of the image.The scale however does update. Also this method produces
> graphs with out ticks for x and y axis which I would like have.
>
> Can anyone point out what I am missing or what I can do differently?
>
> Thanks In advance
>
> Kearn
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131106/2786510c/attachment.html>


More information about the yt-users mailing list