xbout.plotting.plotfuncs.plot3d#
- xbout.plotting.plotfuncs.plot3d(da, style='surface', engine='k3d', levels=None, outputgrid=(100, 100, 25), color_map=None, colorbar=True, colorbar_font_size=None, plot=None, save_as=None, surface_xinds=None, surface_yinds=None, surface_zinds=None, fps=20.0, mayavi_figure=None, mayavi_figure_args=None, mayavi_view=None, **kwargs)[source]#
Make a 3d plot
Warning
3d plotting functionality is still a bit of a work in progress. Bugs are likely, and help developing is welcome!
- Parameters:
style (
{'surface', 'poloidal planes'}
) – Type of plot to make: - ‘surface’ plots the outer surface of the DataArray - ‘poloidal planes’ plots each poloidal plane in the DataArrayengine (
{'k3d', 'mayavi'}
) – 3d plotting library to uselevels (
sequence
of(float
,float)
) – For isosurface, the pairs of (level-value, opacity) to plotoutputgrid (
(int
,int
,int)
orNone
, optional) – For isosurface or volume plots, the number of points to use in the Cartesian (X,Y,Z) grid, that data is interpolated onto for plotting. If None, then do not interpolate and treat “bout_xdim”, “bout_ydim” and “bout_zdim” coordinates as Cartesian (useful for slab simulations).color_map (
k3d color map
, optional) – Color map for k3d plotscolorbar (
bool
ordict
, defaultTrue
) – Add a color bar. If a dict is passed, it is passed on to the colorbar() function as keyword arguments.colorbar_font_size (
float
, defaultNone
) – Set the font size used by the colorbar (for engine=”mayavi”)plot (
k3d plot instance
, optional) – Existing plot to add new plots tosave_as (
str
) – Filename to save figure to. Animations will be saved as a sequence of numbered files.surface_xinds (
(int
,int)
, defaultNone
) – Indices to select when plotting radial surfaces. These indices are local to the region being plotted, so values will be strange. Recommend using values relative to the radial boundaries (i.e. positive for inner boundary and negative for outer boundary).surface_yinds (
(int
,int)
, defaultNone
) – Indices to select when plotting poloidal surfaces. These indices are local to the region being plotted, so values will be strange. Recommend using values relative to the poloidal boundaries (i.e. positive for lower boundaries and negative for upper boundaries).surface_zinds (
(int
,int)
, defaultNone
) – Indices to select when plotting toroidal surfacesfps (
float
, default20
) – Frames per second to use when creating an animation.mayavi_figure (
mayavi.core.scene.Scene
, defaultNone
) – Existing Mayavi figure to add this plot to.mayavi_figure_args (
dict
, defaultNone
) – Arguments to use when creating a new Mayavi figure. Ignored ifmayavi_figure
is passed.mayavi_view (
(float
,float
,float)
, defaultNone
) – If set, arguments are passed tomayavi.mlab.view
to set the view whenengine="mayavi"
vmin (
float
) – vmin and vmax are treated specially. If a float is passed, then it is used for vmin/vmax. If the arguments are not passed, then the minimum and maximum of the data are used. For an animation, to get minimum and/or maximum calculated separately for each frame, passvmin=None
and/orvmax=None
explicitly.vmax (
float
) – vmin and vmax are treated specially. If a float is passed, then it is used for vmin/vmax. If the arguments are not passed, then the minimum and maximum of the data are used. For an animation, to get minimum and/or maximum calculated separately for each frame, passvmin=None
and/orvmax=None
explicitly.**kwargs – Extra keyword arguments are passed to the backend plotting function