Class MakePlot#

Class Documentation#

class MakePlot#
This class is used to easily create journal-article-ready plots and subplots. The class can create 2D as well as 3D plots
and even has support for twin y-axes.

Public Functions

__init__(self, StrArrayLike xlabs, StrArrayLike ylabs, Optional[StrArrayLike] titles=None, Optional[StrArrayLike] twinYlabs=None, Optional[StrArrayLike] zlabs=None, Optional[str|dict|Path|list[str]|list[dict]|list[Path]] style=None)#
This function initializes the plot/subplots based on the inputs provided.

Parameters
----------
xlabs: StrArrayLike
    The x-axes labels for the plots
ylabs: StrArrayLike
    The y-axes labels for the plots
titles: StrArrayLike, optional
    The titles for the plots. (Default value = None)
twinYlabs: StrArrayLike, optional
    The twin y-axes labels for the plots. Setting this forces twin axis y-axes. (Default value = None)
zlabs: StrArrayLike, optional
    The z-axes labels of for the plots. Setting this forces subplots to be 3D. (Default value = None)
style : str| dict| Path| list[str]| list[dict]| list[Path]
    Matplotlib style. (Default value = None)
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.
show(self)#
This function shows the plot.
draw(self)#
This function draws the canvas.
save(self, Path fileName, bool transparent=True, Literal["png", "pdf", "ps", "eps", "svg", None] fileType=None)#
This function crops and saves the figure.

Parameters
----------
fileName : Path
    Filename where the figure should be saved.
transparent : bool, optional
    Whether to save the plot with transparency or not. (Default value = True)
fileType : Literal["png", "pdf", "ps", "eps", "svg", None], optional
    File suffix to use. If None, then the suffix will inferred from the suffix of the fileName. (Default value = None)
savePickle(self, Path fileName)#
This function saves the figure in a pickle format so it can be opened and modified later.

Parameters
----------
fileName : Path
    Filename where the figure should be saved. Note, this should not include the file suffix.
saveAll(self, Path fileName, bool transparent=True, Literal["png", "pdf", "ps", "eps", "svg", None] fileType=None)#
This function invokes the save and savePickle functions.

Parameters
----------
fileName : Path
    Filename where the figure should be saved.
transparent : bool, optional
    Whether to save the plot with transparency or not. (Default value = True)
fileType : Literal["png", "pdf", "ps", "eps", "svg", None], optional
    File suffix to use. If None, then the suffix will be inferred from the suffix of the fileName. (Default value = None)
animate(self, Callable[[], Generator[None, None, None]] animFunc, Path outDir="MyMovie", str fileName="images", bool save=True, pint delay=10)#
Creates an animation using a Python generator.

Parameters
----------
animFunc: Callable[[], Generator[None, None, None]]
    Function whose returned generator 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 : pint, optional
     Delay in milliseconds between frames: only used if save = False. (Default value = 10)

Public Members

fig#
ax#
twinAx#