[yt-users] PlotCollection

Nathan Goldbaum nathan12343 at gmail.com
Wed Jan 13 11:52:10 PST 2016


SlicePlot and ProjectionPlot should work with the eps_writer.

On Wednesday, January 13, 2016, Junhwan Choi (최준환) <choi.junhwan at gmail.com>
wrote:

> Hi yt user,
>
> I have old yt script (with yt-2.7-ish) with eps_writer module that
> makes 3x3 multi panel slice plot as follow
> =================================
> import matplotlib as matplotlib
> matplotlib.use('Agg')
> import matplotlib.pylab as pylab
> from yt.mods import *
> import yt.visualization.eps_writer as eps
> import pyx
> import pylab as pl
>
> pl.ion()
> pl.clf()
>
> # load up a dataset
> LBOX1 = 4000
> LBOX2 = 4
> LBOX3 = 0.04
>
> index = 66
> pf = load("../DD%04d/DD%04d" % (index,index))
> den_center = pf.h.find_max("Density")[1]
> # create density slices
> pc = PlotCollection(pf, center=den_center)
>
> p1 =pc.add_slice("Density", "z", center=den_center, use_colorbar=False)
> p2 =pc.add_slice("Density", "x", center=den_center, use_colorbar=False)
> p3 =pc.add_slice("Density", "y", center=den_center, use_colorbar=False)
>
> p1.set_zlim(1e-27, 1e-20)
> p2.set_zlim(1e-27, 1e-20)
> p3.set_zlim(1e-27, 1e-20)
>
> p4 =pc.add_slice("Density", "z",center=den_center, use_colorbar=False)
> p5 =pc.add_slice("Density", "x",center=den_center, use_colorbar=False)
> p6 =pc.add_slice("Density", "y",center=den_center, use_colorbar=False)
>
> p4.set_zlim(2e-20, 2e-14)
> p5.set_zlim(2e-20, 2e-14)
> p6.set_zlim(2e-20, 2e-14)
>
> p7 =pc.add_slice("Density", "z",center=den_center, use_colorbar=False)
> p8 =pc.add_slice("Density", "x",center=den_center, use_colorbar=False)
> p9 =pc.add_slice("Density", "y",center=den_center, use_colorbar=False)
>
> p7.set_zlim(2e-16, 2e-10)
> p8.set_zlim(2e-16, 2e-10)
> p9.set_zlim(2e-16, 2e-10)
>
> p1.set_width(LBOX1,"pc")
> p2.set_width(LBOX1,"pc")
> p3.set_width(LBOX1,"pc")
>
> p4.set_width(LBOX2,"pc")
> p5.set_width(LBOX2,"pc")
> p6.set_width(LBOX2,"pc")
>
> p7.set_width(LBOX3,"pc")
> p8.set_width(LBOX3,"pc")
> p9.set_width(LBOX3,"pc")
>
> ep = eps.multiplot_yt(3,3,pc,bare_axes = True)
> ep.title_box("xy", loc=(0.1,2.95))
> ep.title_box("yz", loc=(1.1,2.95))
> ep.title_box("xz", loc=(2.1,2.95))
> ep.scale_line(label="%6.0f kpc" % (LBOX1/4000.0), size=0.25,
> linewidth=pyx.style.linewidth.Thick, loc=(0.05,3.08))
> ep.scale_line(label="%6.0f pc"  % (LBOX2/4.0)   , size=0.25,
> linewidth=pyx.style.linewidth.Thick, loc=(0.05,2.08))
> ep.scale_line(label="%6.2f pc"  % (LBOX3/4.0)   , size=0.25,
> linewidth=pyx.style.linewidth.Thick, loc=(0.05,1.08))
> ep.save_fig("VelDenSlice4R_%04d"  % (index) )
> pl.clf()
> ==================================
>
> And, now I would like to port to the latest yt.
> I could make most of changes but I found that there is no
> PlotCollection which can pass the figures to eps.multiplot_yt any
> more.
> Is there any alternative way to replace the what PlotCollection and
> add_slice did?
> I also need to include the annotate_xxx so that using imshow is not a
> good option for me.
>
> Thanks in advance,
> Junhwan Choi
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org <javascript:;>
> 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/20160113/26084a30/attachment.html>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list