cavcalc.output.SingleOutput.plot
#
- SingleOutput.plot(xlim='auto', ylim='auto', zlim='auto', filename: Optional[str] = None, logx: bool = False, logy: bool = False, logz: bool = False, cmap: Optional[str] = None, show: bool = True, fig=None)#
Plots the result against the given array-like argument dependencies (if any).
If only one of the given arguments to the
calculate()
call was array-like, then this will plot a standard line plot. Otherwise an image plot, viamatplotlib.pyplot.imshow()
, will be produced.- Parameters:
- xlimstr | Iterable[float], optional; default = “auto”
The limits of the x-axis. Defaults to
"auto"
such that matplotlib determines these automatically. This can be set to"data"
so that the exact limits of the x-axis data are used. An iterable of length two can be used to manually override the x-axis limits; these will simply be forwarded tomatplotlib.pyplot.xlim()
.- ylimstr | Iterable[float], optional; default = “auto”
The limits of the y-axis. Defaults to
"auto"
such that matplotlib determines these automatically. This can be set to"data"
so that the exact limits of the y-axis data are used. An iterable of length two can be used to manually override the y-axis limits; these will simply be forwarded tomatplotlib.pyplot.ylim()
.- zlimstr | Iterable[float], optional; default = “auto”
The limits of the color-bar scale for image plots. Ignored if this is a line plot.
- filenamestr, optional; default = None
A filename to save the figure to.
- logxbool, optional; default = False
Whether to use a log-scale on the x-axis. Ignored if this is an image plot.
- logybool, optional; default = False
Whether to use a log-scale on the y-axis. Ignored if this is an image plot.
- logzbool, optional; default = False
Whether to use a log normalisation of the image plot Z data. Ignored if this is a line plot.
- cmapstr |
matplotlib.colors.ListedColormap
, optional; default = None Name, or instance, of the colormap to use for image plots. If not given, the colormap will default to the relevant
matplotlib.rcParams
value. Ignored if this is a line plot.- showbool, optional; default = False
Shows the resulting figure, via
matplotlib.pyplot.show()
, if true.- fig
matplotlib.figure.Figure
, optional; default = None An optional pre-existing figure object to draw on. If not given, then a new figure is created and used.
- Returns:
- fig
matplotlib.figure.Figure
The matplotlib Figure object.
- fig
- Raises:
- cce
CavCalcError
If the value of
SingleOutput.result
is not array-like (i.e. no dependencies of the target parameter were array-like, when making thecalculate()
call).
- cce