Class MakePlot#

Class Documentation#

class MakePlot#
MakePlot class for Mayavi.

Public Functions

__init__(self)#
This function initializes the plot.
FullScreen(self)#
This function makes the plot fullscreen.
PartScreen(self, float width, float height)#
This function makes the plot width x height inches.

Parameters
----------
width : float
    Width of the plot in inches.

height : float
    Height of the plot in inches.
animate(self, Callable[[], Generator[None, None, None]] animFunc, Path outDir="MyMovie", str fileName="images", bool save=True, IntRange delay=10)#
Parameters
----------
animFunc : Callable[[], Generator[None, None, None]]
    Function that modifies what is displayed on the plot
outDir : Path, optional
    Directory to save frames in: only used if save = True. (Default value = "MyMovie")
fileName : str, optional
    Filename for the frames: only used if save = True. (Default value = "images")
save : bool, optional
    Controls whether the function saves the frames of the animation or not. (Default value = True)
delay: IntRange in [10,100000], optional
    Controls the delay used by mlab.animate. (Default value = 10)

Returns
-------
animator : Optional[mayavi.tools.animator.Animator]
    Returns an animator object only if save = False. Otherwise, there is no return value.
save(self, Path fileName, Literal["png", "jpg", "bmp", "tiff", "ps", "eps", "pdf", "rib", "oogl", "iv", "wrl", "vrml", "obj", "x3d", "pov", None,] fileType=None)#
This function saves the figure.

Parameters
----------
fileName : Path
    Filename where the figure should be saved.
fileType : Literal["png", "jpg", "bmp", "tiff", "ps", "eps", "pdf", "rib", "oogl", "iv", "wrl", "vrml", "obj", "x3d", "pov", None], optional
    File suffix to use. If None, then the suffix will be inferred from the file name. (Default value = None)
show(self)#
Re-draw the class's figure.
show_axes(self)#
Adds axes indicator.
show_axes(self, bool val)#
Set axes indicator.

Parameters
----------
val : bool
    True turns on the axes indicator and False turns off the axes indicator.
view(self, *Any args, **Any kwargs)#
Call mlab's view on the class's figure.

Parameters
----------
*args : Any
    args passed on to view
**kwargs : Any
    kwargs passed on to view
points3d(self, *Any args, **Any kwargs)#
Call mlab's points3d on the class's figure.

Parameters
----------
*args : Any
    args passed on to points3d
**kwargs : Any
    kwargs passed on to points3d after being processed by _ProcessKwargs.

Returns:
--------
points3d : mayavi.modules.glyph.Glyph
    Glyphs corresponding to the points.
plot3d(self, *Any args, **Any kwargs)#
Call mlab's plot3d on the class's figure.

Parameters
----------
*args : Any
    args passed on to plot3d
**kwargs : Any
    kwargs passed on to plot3d after being processed by _ProcessKwargs.

Returns:
--------
surf : mayavi.modules.surface.Surface
    Line as a Mayavi surface.
surf(self, *Any args, **Any kwargs)#
Call mlab's surf on the class's figure.

Parameters
----------
*args : Any
    args passed on to surf
**kwargs : Any
    kwargs passed on to surf after being processed by _ProcessKwargs.

Returns:
--------
surf : mayavi.modules.surface.Surface
    Surface.
quiver3d(self, *Any args, **Any kwargs)#
Call mlab's quiver3d on the class's figure.

Parameters
----------
*args : Any
    args passed on to quiver3d
**kwargs : Any
    kwargs passed on to quiver3d after being processed by _ProcessKwargs.

Returns:
--------
vectors : mayavi.modules.vectors.Vectors
    Vectors associated with the quiver3d plot.
mesh(self, *Any args, **Any kwargs)#
Call mlab's mesh on the class's figure.

Parameters
----------
*args : Any
    args passed on to mesh
**kwargs : Any
    kwargs passed on to mesh after being processed by _ProcessKwargs.

Returns:
--------
mesh : mayavi.modules.surface.Surface
    Mesh as a mayavi surface.
contour3d(self, *Any args, **Any kwargs)#
Call mlab's contour3d on the class's figure.

Parameters
----------
*args : Any
    args passed on to contour3d
**kwargs : Any
    kwargs passed on to mesh after being processed by _ProcessKwargs.

Returns:
--------
contour : mayavi.modules.iso_surface.IsoSurface
    Coutour.

Public Members

fig#
scene#

Public Static Functions

ColormapGradient(Color c1, Color c2)#
Returns a Mayavi LUT for a gradient that linearly transforms from c1 to c2.

Parameters
----------
c1 : Color
    Input color as a string or 4-element RGBA list.

c2 : Color
    Input color as a string or 4-element RGBA list.

Returns
-------
lut : npt.NDArray[np.uint8]
    Mayavi LUT for a gradient that linearly transforms from c1 to c2.
SetColormapGradient(Any obj, Color c1, Color c2)#
Applies a linear, gradient colormap to the object. The colors in the gradient are c1 and c2.

Parameters
----------
obj : Any
    mlab object to apply the colormap gradient to.
c1 : Color
    Input color as a string or 4-element RGBA list.
c2 : Color
    Input color as a string or 4-element RGBA list.

Public Static Attributes

IntRange = Annotated[int, Ge(10), Le(100000)]#

Protected Static Functions

_str_to_rgb(str color)#
Call matplotlib's colorConverter.to_rgb on input string.

Parameters
----------
color : str
    Color string

Returns
-------
color_rgb : tuple[float, float, float]
    3-tuple of the RGB for the color
_str_to_rgba(color, Optional[float] alpha=None)#
Call matplotlib's colorConverter.to_rgba on input string.

Parameters
----------
color : str
    Color string

alpha : float
    Alpha value to use in the return RGBA. If None, then the returned alpha = 1. (Default value = None)

Returns
-------
color_rgba : tuple[float, float, float, float]
    4-tuple of the RGB for the color
_ProcessKwargs(**Any kwargs)#
This function effectively extends common mlab keywords.

Parameters
----------
**kwargs : Any
    keyword arguments

Returns
-------
kwargs : dict[str, any]
    Same as input keyword arguments but color has been transformed to an RGB if it was a string.