yt.raven.PlotCollection.add_phase_sphere

PlotCollection.add_phase_sphere(radius, unit, fields, center=None, cmap=None, weight='CellMassMsun', accumulation=False, x_bins=64, x_log=True, x_bounds=None, y_bins=64, y_log=True, y_bounds=None, lazy_reader=True, id=None, axes=None, figure=None, fractional=False)

From a description of a sphere, create a 2D, binned profile.

This function will accept the radius of a sphere, and from that it will generate a Binned1DProfile, based on the specified options. The profile will be 2D, which means while it can have an arbitrary number of fields, those fields will all be binned based on two fields.

All subsequent parameters beyond “unit” will be passed verbatim to add_profile_object.

Parameters :

radius : float

The radius of the sphere to generate.

unit : string

The unit in which the given radius is expressed.

fields : list of strings

The first element of this list is the field by which we will bin into the y-axis, the second is the field by which we will bin onto the y-axis. All subsequent fields will be binned and their profiles added to the underlying BinnedProfile2D.

center : array_like, optional

The center to be used for things like radius and radial velocity. Defaults to the center of the plot collection.

cmap : string, optional

An acceptable colormap. See either raven.color_maps or http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps .

weight : string, default “CellMassMsun”

The weighting field for an average. This defaults to mass-weighted averaging.

accumulation : list of booleans, optional

If true, from the low-value to the high-value the values in all binned fields will be accumulated. This is useful for instance when adding an unweighted CellMassMsun to a radial plot, as it will show mass interior to that radius. The first value is for the x-axis, the second value for the y-axis. Note that accumulation will only be along each row or column.

x_bins : int, optional

How many bins should there be in the x-axis variable?

x_log : boolean, optional

Should the bin edges be log-spaced?

x_bounds : tuple of floats, optional

If specified, the boundary values for the binning. If unspecified, the min/max from the data_source will be used. (Non-zero min/max in case of log-spacing.)

y_bins : int, optional

How many bins should there be in the y-axis variable?

y_log : boolean, optional

Should the bin edges be log-spaced?

y_bounds : tuple of floats, optional

If specified, the boundary values for the binning. If unspecified, the min/max from the data_source will be used. (Non-zero min/max in case of log-spacing.)

lazy_reader : boolean, optional

If this is false, all of the data will be read into memory before any processing occurs. It defaults to true, and grids are binned on a one-by-one basis. Note that parallel computation requires this to be true.

id : int, optional

If specified, this will be the “semi-unique id” of the resultant plot. This should not be set.

figure : matplotlib.figure.Figure, optional

The figure onto which the axes will be placed. Typically not used unless axes is also specified.

axes : matplotlib.axes.Axes, optional

The axes object which will be used to create the image plot. Typically used for things like multiplots and the like.

fractional : boolean

If true, the plot will be normalized to the sum of all the binned values.

Returns :

plot : yt.raven.PhasePlot

The plot that has been added to the PlotCollection.

See also

yt.lagos.BinnedProfile2D
This is the object that does the transformation of raw data into a 1D profile.

Examples

This will show the mass-distribution in the Density-Temperature plane.

>>> pc.add_phase_sphere(1.0, 'kpc',
        ["Density", "Temperature", "CellMassMsun"], weight = None)

Previous topic

yt.raven.PlotCollection.add_phase_object

Next topic

yt.raven.PlotCollection.add_profile_object

This Page