[yt-users] yt SlicePlot questions

Jun-Hwan Choi jhchoi at pa.uky.edu
Thu Jan 17 11:41:25 PST 2013


Hi all,

I have two questions on yt SlicePlot.
First, when I make a new field and generate the SlicePlot of the 
simulation with a given field, I face on following error message:
Traceback (most recent call last):
   File "Pot.py", line 16, in <module>
     pc = SlicePlot(pf, "x", "PotentialFieldCGS", width = (6.0, 
'kpc'),center=den_center)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", 
line 804, in __init__
     PWViewerMPL.__init__(self, slc, bounds, origin=origin)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", 
line 447, in __init__
     if setup: self._setup_plots()
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", 
line 617, in _setup_plots
     self.plots[f].image, cax = self.plots[f].cax)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/figure.py", 
line 1104, in colorbar
     cb = cbar.Colorbar(cax, mappable, **kw)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/colorbar.py", line 
731, in __init__
     ColorbarBase.__init__(self, ax, **kw)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/colorbar.py", line 
246, in __init__
     self.draw_all()
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/colorbar.py", line 
260, in draw_all
     self._process_values()
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/colorbar.py", line 
558, in _process_values
     b = self.norm.inverse(self._uniform_y(self.cmap.N+1))
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/matplotlib/colors.py", 
line 895, in inverse
     return vmin * ma.power((vmax/vmin), val)
   File 
"/home/jhchoi/common/lib/python2.7/site-packages/numpy/ma/core.py", line 
6043, in power
     m |= invalid
ValueError: invalid return array shape

I suspect the reason is that Field value is negative and z value tends 
to be log scale (because I make it positive the yt work).
Is there any way to make plot in negative with making linear z-value?

Second, when I make a SlicePlot with small region, owing to resolution 
(certain grid cell size is not 1/10 of the Sire x-y size) the plot looks 
ugly.
Is there any way to visually improve the low resolution SlicePlot?

Thank you in advance,
Junhwan

-- 
--------------------------------------------------------------
Jun-Hwan Choi, Ph.D.
Department of Physics and Astronomy, University of Kentucky
Tel: (859) 897-6737        Fax: (859) 323-2846
Email: jhchoi at pa.uky.edu   URL: http://www.pa.uky.edu/~jhchoi
--------------------------------------------------------------




More information about the yt-users mailing list