[yt-dev] Issue #1180: PhasePlot and negative numbers (yt_analysis/yt)

Alex Hill issues-reply at bitbucket.org
Thu Mar 3 10:48:11 PST 2016


New issue 1180: PhasePlot and negative numbers
https://bitbucket.org/yt_analysis/yt/issues/1180/phaseplot-and-negative-numbers

Alex Hill:

yt.PhasePlot drops cells with negative velocities because it is initialized with the axis as a log:


```
#!python

f = yt.PhasePlot(box, 'temperature', 'velocity_z',['cell_mass'],
                 weight_field=None,fractional=True)
f.set_log('velocity_z', False)
f.show()

```

In this code, every cell with velocity_z < 0 is blank. This can be fixed by calling set_ylim() after set_log():


```
#!python

f = yt.PhasePlot(box, 'temperature', 'velocity_z',['cell_mass'],
                 weight_field=None,fractional=True)
f.set_log('velocity_z', False)
ax = f.plots['cell_mass'].axes
ax.set_ylim(-5e7,5e7)
f.show()

```

but automatic determination of the axis limits does not work.

It would be good to invalidate the plot limits after calling set_log() to determine the axis limits automatically.





More information about the yt-dev mailing list