[yt-users] PhasePlot losing negative values

Nathan Goldbaum nathan12343 at gmail.com
Thu Dec 17 13:13:29 PST 2015


Hi Alex,

So I think what's happening is that the call to set_log() doesn't cause the
plot limits for the velocity_z axis to be rescaled, cutting off the
negative values in the plot. This can be fixed by calling set_ylim() after
set_log():

*https://gist.github.com/anonymous/4ec4fdfd66b0eee2015a
<https://gist.github.com/anonymous/4ec4fdfd66b0eee2015a>*

I think a good enhancement would be to somehow invalidate the plot limits
after calling set_log() so the y-axis limits are automatically
re-determined. I think this would be a reasonably straightforward fix and a
good first yt contribution if you're up for it. If you're not interested in
working on that yourself, can you go ahead and open an issue so we don't
lose this in the shuffle:

https://bitbucket.org/yt_analysis/yt/issues/new

Thanks!

-Nathan

On Thu, Dec 17, 2015 at 2:55 PM, Alex Hill <ashill at haverford.edu> wrote:

> Hi,
>
> I’m trying to create a PhasePlot of one component of velocity (which can
> be negative) as a function of temperature.
>
> f = yt.PhasePlot(box, ‘temperature’, ‘velocity_z’,[‘cell_mass’],
> weight_field=None,fractional=True)
> f.set_log(‘velocity_z’, False)
> f.show()
>
> This works as expected for cells with positive velocity. However, cells
> with negative velocities get completely dropped; everything with velocity_z
> <= 0 is blank.
>
> I assume that PhasePlot took the logarithm of velocity_z at some point in
> producing the plot and lost negative data. Is there an option I’m missing
> to tell PhasePlot not to do this?
>
> Running yt 3.2.2 and python 2.7 on a Mac.
>
> Cheers,
>  Alex
>
> ---------
> Alex Hill
> Senior Postdoctoral Research Associate
> Office: KINSC Link L106
> Department of Astronomy, Haverford College
> 370 Lancaster Ave, Haverford, PA 19041 USA
> phone: +1 484 297 2136
> email/iMessage: ashill at haverford.edu
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> 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/20151217/59b0f4a4/attachment.htm>


More information about the yt-users mailing list