yt.visualization.profile_plotter.
PhasePlot
(data_source, x_field, y_field, z_fields, weight_field='cell_mass', x_bins=128, y_bins=128, accumulation=False, fractional=False, fontsize=18, figure_size=8.0)[source]¶Create a 2d profile (phase) plot from a data source or from profile object created with yt.data_objects.profiles.create_profile.
Given a data object (all_data, region, sphere, etc.), an x field, y field, and z field (or fields), this will create a two-dimensional profile of the average (or total) value of the z field in bins of the x and y fields.
Parameters: | data_source : YTSelectionContainer Object
x_field : str
y_field : str
z_fields : str or list
weight_field : str
x_bins : int
y_bins : int
accumulation : bool or list of bools
fractional : If True the profile values are divided by the sum of all
profile : profile object
fontsize: int :
figure_size : int
|
---|
Examples
>>> import yt
>>> ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046")
>>> ad = ds.all_data()
>>> plot = PhasePlot(ad, "density", "temperature", ["cell_mass"],
... weight_field=None)
>>> plot.save()
>>> # Change plot properties.
>>> plot.set_cmap("cell_mass", "jet")
>>> plot.set_zlim("cell_mass", 1e8, 1e13)
>>> plot.set_title("cell_mass", "This is a phase plot")
Attributes
Methods