
Hi yt-users! I would like to make phaseplots without the colorbar. I tried to just use the plot.hide_colorbar() command, but apparently PhasePlot has no attribute hide_colorbar() Looking at the docs, perhaps what I have to do it use PhasePlotMPL? Is there an example using this somewhere in the docs? Thanks in advance for any help/direction!! Stephanie -- Dr. Stephanie Tonnesen Associate Research Scientist CCA, Flatiron Institute New York, NY stonnes@gmail.com

Hi Stephanie, You're right that PhasePlot is missing a hide_colorbar method, I've filed an issue to add that: https://github.com/yt-project/yt/issues/1736 For now you can do something like this: plot = yt.PhasePlot(ds.all_data(), 'density', 'temperature', 'cell_mass') p = plot.plots['cell_mass'] p.hide_colorbar() plot.save() In this case, "p" is the PhasePlotMPL instance you were looking for. Another way to do this would be to make the plot manually using the underlying Profile2D object and matplotlib's pcolormesh function: from matplotlib import pyplot as plt import numpy as np profile = yt.create_profile(ds.all_data(), ['density', 'temperature'], ['cell_mass']) fig, ax = plt.subplots() ax.set_xscale('log') ax.set_yscale('log') ax.pcolormesh(profile.x, profile.y, np.log10(profile['cell_mass'].T)) plt.show() Hope that's helpful, Nathan On Sun, Mar 25, 2018 at 8:49 PM, Stephanie Tonnesen <stonnes@gmail.com> wrote:
Hi yt-users!
I would like to make phaseplots without the colorbar. I tried to just use the plot.hide_colorbar() command, but apparently PhasePlot has no attribute hide_colorbar()
Looking at the docs, perhaps what I have to do it use PhasePlotMPL? Is there an example using this somewhere in the docs?
Thanks in advance for any help/direction!!
Stephanie
-- Dr. Stephanie Tonnesen Associate Research Scientist CCA, Flatiron Institute New York, NY
stonnes@gmail.com
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

That worked perfectly, thanks! (used the first solution) Best, Stephanie -- Dr. Stephanie Tonnesen Associate Research Scientist CCA, Flatiron Institute New York, NY stonnes@gmail.com On Mon, Mar 26, 2018 at 10:45 AM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
Hi Stephanie,
You're right that PhasePlot is missing a hide_colorbar method, I've filed an issue to add that:
https://github.com/yt-project/yt/issues/1736
For now you can do something like this:
plot = yt.PhasePlot(ds.all_data(), 'density', 'temperature', 'cell_mass') p = plot.plots['cell_mass'] p.hide_colorbar() plot.save()
In this case, "p" is the PhasePlotMPL instance you were looking for.
Another way to do this would be to make the plot manually using the underlying Profile2D object and matplotlib's pcolormesh function:
from matplotlib import pyplot as plt import numpy as np profile = yt.create_profile(ds.all_data(), ['density', 'temperature'], ['cell_mass'])
fig, ax = plt.subplots() ax.set_xscale('log') ax.set_yscale('log') ax.pcolormesh(profile.x, profile.y, np.log10(profile['cell_mass'].T))
plt.show()
Hope that's helpful,
Nathan
On Sun, Mar 25, 2018 at 8:49 PM, Stephanie Tonnesen <stonnes@gmail.com> wrote:
Hi yt-users!
I would like to make phaseplots without the colorbar. I tried to just use the plot.hide_colorbar() command, but apparently PhasePlot has no attribute hide_colorbar()
Looking at the docs, perhaps what I have to do it use PhasePlotMPL? Is there an example using this somewhere in the docs?
Thanks in advance for any help/direction!!
Stephanie
-- Dr. Stephanie Tonnesen Associate Research Scientist CCA, Flatiron Institute New York, NY
stonnes@gmail.com
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (2)
-
Nathan Goldbaum
-
Stephanie Tonnesen