[yt-users] In temperature plot unable to plot in normal scale

Kacper Kowalik xarthisius.kk at gmail.com
Fri Aug 9 22:25:08 PDT 2013


On 08/08/2013 10:05 AM, Reju Sam John wrote:
> Dear All,
> I am trying to plot a multi plot of temperatures at different red-shifts
> with following script.
> 
> from yt.mods import * # set up our namespace
> import matplotlib.colorbar as cb
> 
> fig, axes, colorbars = get_multi_plot( 3, 1, colorbar='vertical', bw = 4)
> 
> file1="/app/run/csarkar/surajit/simulation_shock/simulation5/RD00"
> file2="/RedshiftOutput00"
> list = [11,13,22]
> m=0
> #for kk in range(20,37):
> for kk in list:
>     fn_i=str(kk)
>     fn=file1+fn_i+file2+fn_i # parameter file to load
>     print fn
>     pf = load(fn) # load data
>     pc = PlotCollection(pf, center=[0.5,0.5,0.5]) # defaults to center at
> most dense point#dd = pf.h.all_data()
>     p = pc.add_slice("Temperature", 1, figure = fig, axes = axes[0][m],
> use_colorbar=False)
>     p.set_log_field(False)
>     p.set_zlim(1e4,5e7)
>     #p.set_cmap("jet")# a different colormap
>     p.modify["contour"]("Density", ncont=9, plot_args =
> {'colors':'w'},clim=(5e-30,5e-25))
>     #p.modify["contour"]("Temperature", ncont=10, plot_args =
> {'colors':'k'},clim=(3e7,1e8))
>     pc.set_width(15, 'mpc') # change width of all plots in pc
>     m=m+1
>     #pc.save("%s_p.png" % pf) # save all plots
>     for p, cax in zip(pc.plots, colorbars):
>     cbar = cb.Colorbar(cax, p.image, orientation='vertical')
>     p.colorbar = cbar
>     p._autoset_label()
>     fig.savefig("Temperature_at_rd00_11,13,22" % pf)
> 
> The problem is that I am getting the temperature in log scale, even-though
> I used  p.set_log_field(False)
> in my script.

Hi,
I'm not exactly sure why set_log_field doesn't work for you, but you
could try to call:

pf.field_info["Temperature"].take_log = False

after loading a file.
Cheers,
Kacper

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130810/eca0085c/attachment.pgp>


More information about the yt-users mailing list