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

k.grisdale at surrey.ac.uk k.grisdale at surrey.ac.uk
Wed Nov 6 04:32:35 PST 2013


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






More information about the yt-users mailing list