yt.visualization.plot_window.OffAxisSlicePlot

class yt.visualization.plot_window.OffAxisSlicePlot(ds, normal, fields, center='c', width=None, axes_unit=None, north_vector=None, fontsize=18, field_parameters=None, data_source=None)[source]

Creates an off axis slice plot from a dataset

Given a ds object, a normal vector defining a slicing plane, and a field name string, this will return a PWViewerMPL object containing the plot.

The plot can be updated using one of the many helper functions defined in PlotWindow.

Parameters:

ds : yt.data_objects.api.Dataset

This is the dataset object corresponding to the simulation output to be plotted.

normal : a sequence of floats

The vector normal to the slicing plane.

fields : string

The name of the field(s) to be plotted.

center : A sequence of floats, a string, or a tuple.

The coordinate of the center of the image. If set to ‘c’, ‘center’ or left blank, the plot is centered on the middle of the domain. If set to ‘max’ or ‘m’, the center will be located at the maximum of the (‘gas’, ‘density’) field. Centering on the max or min of a specific field is supported by providing a tuple such as (“min”,”temperature”) or (“max”,”dark_matter_density”). Units can be specified by passing in center as a tuple containing a coordinate and string unit name or by passing in a YTArray. If a list or unitless array is supplied, code units are assumed.

width : tuple or a float.

Width can have four different formats to support windows with variable x and y widths. They are:

format example
(float, string) (10,’kpc’)
((float, string), (float, string)) ((10,’kpc’),(15,’kpc’))
float 0.2
(float, float) (0.2, 0.3)

For example, (10, ‘kpc’) requests a plot window that is 10 kiloparsecs wide in the x and y directions, ((10,’kpc’),(15,’kpc’)) requests a window that is 10 kiloparsecs wide along the x axis and 15 kiloparsecs wide along the y axis. In the other two examples, code units are assumed, for example (0.2, 0.3) requests a plot that has an x width of 0.2 and a y width of 0.3 in code units. If units are provided the resulting plot axis labels will use the supplied units.

axes_unit : A string

The name of the unit for the tick labels on the x and y axes. Defaults to None, which automatically picks an appropriate unit. If axes_unit is ‘1’, ‘u’, or ‘unitary’, it will not display the units, and only show the axes name.

north-vector : a sequence of floats

A vector defining the ‘up’ direction in the plot. This option sets the orientation of the slicing plane. If not set, an arbitrary grid-aligned north-vector is chosen.

fontsize : integer

The size of the fonts for the axis, colorbar, and tick labels.

field_parameters : dictionary

A dictionary of field parameters than can be accessed by derived fields.

data_source : YTSelectionContainer Object

Object to be used for data selection. Defaults to a region covering the entire simulation.

Methods