Plot Collection
PlotCollection is the basic means by which most of your backend-plotting will
take place, and it contains a number of convenience functions for generating
images and manipulating existing plots.
-
class yt.raven.PlotCollection(pf, deliverator_id=-1, center=None)
Generate a collection of linked plots using pf as a source,
optionally submitting to the deliverator with deliverator_id
and with center, which will otherwise be taken to be the point of
maximum density.
-
add_cutting_plane(field, normal, center=None, use_colorbar=True, figure=None, axes=None, fig_size=None, obj=None)
- Generate a cutting plane of field with normal, centered at center
(defaults to PlotCollection center) with use_colorbar
specifying whether the plot is naked or not and optionally
providing pre-existing Matplotlib figure and axes objects.
fig_size in (height_inches, width_inches). If so desired,
obj is a pre-existing cutting plane object.
-
add_phase_object(data_source, fields, 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=False, id=None, axes=None, figure=None)
- Given a data_source, and fields, automatically generate a 2D
profile and plot it. id is used internally to add onto the prefix,
and will be automatically generated if not given. Remainder of
arguments are identical to add_profile_object().
-
add_phase_sphere(radius, unit, fields, **kwargs)
- Given a radius and unit, generate a 2D profile from a sphere, with
fields as the x,y,z. Automatically weights z by CellMassMsun.
kwargs get passed onto add_phase_object().
-
add_profile_object(data_source, fields, weight='CellMassMsun', accumulation=False, x_bins=64, x_log=True, x_bounds=None, lazy_reader=False, id=None, axes=None, figure=None)
- Use an existing data object, data_source, to be the source of a
one-dimensional profile. fields will define the x and y bin-by
fields, weight is used to weight the y value, accumulation determines
if y is summed along x, x_bins, x_log and x_bounds define the means of
choosing the bins. id is used internally to differentiate between
multiple plots in a single collection. lazy_reader determines the
memory-conservative status.
-
add_profile_sphere(radius, unit, fields, **kwargs)
- Generate a spherical 1D profile, given only a radius, a unit,
and at least two fields. Any remaining kwargs will be passed onto
add_profile_object().
-
add_projection(field, axis, weight_field=None, center=None, use_colorbar=True, figure=None, axes=None, fig_size=None)
- Generate a projection of field along axis, optionally giving
a weight_field-weighted average with use_colorbar
specifying whether the plot is naked or not and optionally
providing pre-existing Matplotlib figure and axes objects.
fig_size in (height_inches, width_inches)
-
add_slice(field, axis, coord=None, center=None, use_colorbar=True, figure=None, axes=None, fig_size=None)
- Generate a slice through field along axis, optionally at
[axis]=*coord*, with the center attribute given (some
degeneracy with coord, but not complete), with use_colorbar
specifying whether the plot is naked or not and optionally
providing pre-existing Matplotlib figure and axes objects.
fig_size in (height_inches, width_inches)
-
autoscale()
- Turn back on autoscaling.
-
clear_plots()
- Delete all plots and their attendant data.
-
save(basename, format='png', override=False)
- Same plots with automatically generated names, prefixed with basename
(including directory path) unless override is specified, and in
format.
-
set_cmap(cmap)
- Change the colormap of all plots to cmap.
-
set_lim(lim)
- Shorthand for setting x,y at same time.
lim should be formatted as (xmin,xmax,ymin,ymax)
-
set_width(width, unit)
- Set the witdh of the slices, cutting planes and projections to be
width units
-
set_xlim(xmin, xmax)
- Set the x boundaries of all plots.
-
set_ylim(ymin, ymax)
- Set the y boundaries of all plots.
-
set_zlim(zmin, zmax)
- Set the limits of the colorbar.
-
switch_field(field)
- Change all the fields displayed to be field
-
switch_z(field)
- Change all the fields displayed to be field