[yt-users] 3 by 3 multi plot
Reju Sam John
rejusamjohn at gmail.com
Tue Nov 19 06:18:07 PST 2013
Dear All,
I am trying to create a 3 by 3 multi plot of densities at different
redshifts. But things are failing. But we managed to create a 1 by 3 multi
plot with the following code. Can anybody suggest a method to create a 3 by
3 multi plot of density slice.
from yt.mods import *
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 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=True)
p.set_log_field(True)
p.modify["contour"]("Density", ncont=9, plot_args =
{'colors':'w'},clim=(5e-30,5e-25))
pc.set_width(15, 'mpc') # change width of all plots in pc
m=m+1
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)
--
Reju Sam John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131119/1b0dbfa4/attachment.htm>
More information about the yt-users
mailing list