[yt-users] get_multi_plot error

Christine Simpson csimpson at astro.columbia.edu
Thu Oct 21 11:28:34 PDT 2010


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)






More information about the yt-users mailing list