[yt-users] create_profile of linear fields
Douglas Harvey Rudd
drudd at uchicago.edu
Fri Oct 31 14:08:35 PDT 2014
Hi all,
Is there a way to specify the log/non-log scaling of a y-axis variable in create_profile or ProfilePlot.from_profiles? I have some profiles that start flat at an initial time and so the velocity_magnitude is everywhere 0. create_profile succeeds, but ProfilePlot.from_profiles generates a Matplotlib error before I have the ability to specify a scaling:
sph = ds.sphere(ds.domain_center, ds.domain_width[0]/2)
profile = yt.create_profile(sph, "radius",
["density", "temperature", "velocity_magnitude", "dx"],
extrema={'radius':(ds.domain_width[0]/ds.num_grid,ds.domain_width[0]/2.)},
n_bins=int(ds.domain_width[0]*2.**(ds.max_level-1)),
logs={'radius':False},
units={'radius':'pc'})
plot = yt.ProfilePlot.from_profiles(profile)
Relevant part of the dump:
/software/python-2.7-2014q3-el6-x86_64/lib/python2.7/site-packages/matplotlib-1.4.0-py2.7-linux-x86_64.egg/matplotlib/ticker.pyc in view_limits(self, vmin, vmax)
1523 if minpos <= 0 or not np.isfinite(minpos):
1524 raise ValueError(
-> 1525 "Data has no positive values, and therefore can not be "
1526 "log-scaled.")
1527
Douglas Rudd
Scientific Computing Consultant
Research Computing Center
drudd at uchicago.edu
More information about the yt-users
mailing list