plt_zoom
- PlasmaCalcs.plotting.plot_tools.lims.plt_zoom(x='both', margin=None, *, ax=None, plot_settings=None, data_interval=None, skipna=True, scale=None)
zoom in/out to view the data with the specified margin.
Default is to zoom both axes such that all data is viewable, with a small margin.x: ‘both’, ‘x’, or ‘y’axis for which to set the margin.if None, set margin for xaxis and yaxis.margin: None or number (greater than -0.5, probably close to 0.05) (default: None)margin to use for x/y axis, as a fraction of the data interval for that axis.None –> use matplotlib defaults(e.g., plt.rcParams[“axes.xmargin”] or [“axes.ymargin”], or 0 if using imshow)positive number –> pad around the data region, with this much whitespace.E.g. 0.05 means adding 5% whitespace on each side.Use this to zoom out.negative number –> remove this much of the outer parts of the data region.E.g. -0.2 means removing 20% space from each side.Use this to zoom in.For line plots, if also usingrobust, ymargin will be applied to the robust y lims.(margin-related params share the same docstring, but refer to:‘xmargin’: x-axis, ‘ymargin’: y-axis, ‘margin’: x and/or y-axis.)ax: None or matplotlib axis objectthe Axes on which to set the margin(s). None –> ax=plt.gca().plot_settings: None or PlotSettings instanceif margin is None, get from plot_settings (or matplotlib defaults if None in plot_settings)data_interval: None or [min, max]if provided, use this instead of the actual range of data from the plot.skipna: boolwhether to return None instead of nan if min or max would be nan.scale: None, ‘linear’, or ‘log’whether margin is in linear or log space. If None, use ax’s current scale.returns the new plt.xlim() or plt.ylim().If x is None, returns (plt.xlim(), plt.ylim()) instead.