[yt-users] get_multi_plot error

Matthew Turk matthewturk at gmail.com
Thu Oct 21 12:57:50 PDT 2010


Hi Christine,

Thanks for reporting thing.  I've fixed it in the current changeset in
the hg repo.

As some background, what's going on here is that previously, yt
abstracted *All* of the choice of backend.  Unfortunately, as with all
abstractions, this never completely covered all the bases.  This is
where "be.engineVals" came from -- the idea was that you should be
able to swap out different FigureCanvas objects, for instance to use a
GUI and whatnot.  This wasn't ever really appropriate for the multi
plot, and since the backend is now only matplotlib with some limited
direct image writing, I've gone ahead and changed it.  It now grabs
FigureCanvasAgg, which is how the rest of the plots behave, as well.

Let us know if you have any more problems,

Matt

On Thu, Oct 21, 2010 at 11:28 AM, Christine Simpson
<csimpson at astro.columbia.edu> wrote:
> Hi all,
>
> I'm trying to make a multi plot and I'm getting an error that I'm not
> sure how to fix.  I'd appreciate any help you could give.  I've pasted
> the error and script below.  I'm not sure I understand what the issue is
> that it is complaining about.  What is engineVals?  I used this script
> with the old version of yt, although I made a few changes to get it to
> work with the new repository.
>
> Here is the error:
>
> yt         INFO       2010-10-21 13:06:28,094 Getting the binary
> hierarchy
> yt         INFO       2010-10-21 13:06:28,488 Finished with binary
> hierarchy reading
> yt         INFO       2010-10-21 13:07:07,696 Max Value is 1.42629e-28
> at 0.5039215087890625 0.5306854248046875 0.5584259033203125 in grid
> EnzoGrid_2576 at level 8 (16, 15, 6)
> yt         INFO       2010-10-21 13:07:07,698 Created plot collection
> with default plot-center = [0.5039215087890625, 0.5306854248046875,
> 0.5584259033203125]
> Traceback (most recent call last):
>  File "multi_plot_25kpc.py", line 14, in <module>
>    fig, axes, colorbars = get_multi_plot( 2, 1, colorbar=orient, bw =
> 4)
>  File
> "/share/home/01112/tg803911/yt_new/yt/yt/visualization/plot_collection.py", line 1672, in get_multi_plot
>    fig.set_canvas(be.engineVals["canvas"](fig))
> NameError: global name 'be' is not defined
>
>
> Here is the script that produced it:
>
> from yt.mods import *
> from yt.visualization.api import PlotCollection
>
> import matplotlib.colorbar as cb
>
> fn = "DD0060/output_0060"
> orient = 'horizontal'
>
> pf = load(fn)
>
> pc = PlotCollection(pf)
> fig, axes, colorbars = get_multi_plot( 2, 1, colorbar=orient, bw = 4)
>
>
> #Density
> p = pc.add_projection("Density",0,figure = fig, axes = axes[0][0],
> use_colorbar=False)
> p.set_cmap("bds_highcontrast")
> p.set_zlim(8*10**(-6),10**(-3))
>
>
> #Temperature
> p = pc.add_projection("Temperature", 0,
> weight_field="Density",figure=fig, axes=axes[0][1], use_colorbar=False)
> p.set_cmap("hot")
> p.set_zlim(500,20000)
>
> pc.set_width(25.0, 'kpc')
>
> for p, cax in zip(pc.plots, colorbars):
>    cbar = cb.Colorbar(cax, p.image, orientation=orient)
>    p.colorbar = cbar
>    p._autoset_label()
>
> fig.savefig("%s_z_25kpc" % pf)
>
>
>
> _______________________________________________
> 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