yt.visualization.base_plot_types module¶
- class yt.visualization.base_plot_types.CallbackWrapper(viewer, window_plot, frb, field, font_properties, font_color)[source]¶
Bases:
object
- class yt.visualization.base_plot_types.ImagePlotMPL(fsize=None, axrect=None, caxrect=None, *, norm_handler: NormHandler, colorbar_handler: ColorbarHandler, figure: Figure | None = None, axes: Axes | None = None, cax: Axes | None = None)[source]¶
-
A base class for yt plots made using imshow
- save(name, mpl_kwargs=None, canvas=None)¶
Choose backend and save image to disk
- show()¶
- class yt.visualization.base_plot_types.PlotMPL(fsize, axrect: tuple[float, float, float, float], *, norm_handler: NormHandler, figure: Figure | None = None, axes: Axes | None = None)[source]¶
Bases:
object
A base class for all yt plots made using matplotlib, that is backend independent.
- yt.visualization.base_plot_types.get_multi_plot(nx, ny, colorbar='vertical', bw=4, dpi=300, cbar_padding=0.4)[source]¶
Construct a multiple axes plot object, with or without a colorbar, into which multiple plots may be inserted.
This will create a set of
matplotlib.axes.Axes
, all lined up into a grid, which are then returned to the user and which can be used to plot multiple plots on a single figure.- Parameters:
nx (int) – Number of axes to create along the x-direction
ny (int) – Number of axes to create along the y-direction
colorbar ({'vertical', 'horizontal', None}, optional) – Should Axes objects for colorbars be allocated, and if so, should they correspond to the horizontal or vertical set of axes?
bw (number) – The base height/width of an axes object inside the figure, in inches
dpi (number) – The dots per inch fed into the Figure instantiation
- Returns:
fig (
matplotlib.figure.Figure
) – The figure created inside which the axes residetr (list of list of
matplotlib.axes.Axes
objects) – This is a list, where the inner list is along the x-axis and the outer is along the y-axiscbars (list of
matplotlib.axes.Axes
objects) – Each of these is an axes onto which a colorbar can be placed.
Notes
This is a simple implementation for a common use case. Viewing the source can be instructive, and is encouraged to see how to generate more complicated or more specific sets of multiplots for your own purposes.