labcore.analysis.mpl#

Functions

add_legend(ax[, anchor_point, legend_ref_point])

centers2edges(arr)

correctly_sized_figure(widths, heights[, ...])

Create a figure and grid where all dimensions are specified in inches. :param widths: list of column widths :param heights: list of row heights :param margins: either a scalar or a list of four numbers (l, r, t, b) :param dw: white space between subplots, horizontal :param dh: white space between subplots, vertical :param make_axes: bool; if True, create axes on the grid and return, else return the gridspec.

fit_and_plot_1d(ds, name, fit_class[, ...])

format_ax(ax[, top, right, xlog, ylog, ...])

format_right_cb(cb)

get_color_cycle(n, colormap[, start, stop, ...])

pcolorgrid(xaxis, yaxis)

plot_fit_1d(ds, name)

setup_plotting([sns_style, rcparams])

labcore.analysis.mpl.add_legend(ax: Axes, anchor_point: Tuple[float, float] = (1, 1), legend_ref_point: str = 'lower right', **labels_and_handles: Any) None[source]#
labcore.analysis.mpl.centers2edges(arr: ndarray) ndarray[source]#
labcore.analysis.mpl.correctly_sized_figure(widths: List[float], heights: List[float], margins: float | List[float] = 0.5, dw: float = 0.2, dh: float = 0.2, make_axes: bool = True) Any[source]#

Create a figure and grid where all dimensions are specified in inches. :param widths: list of column widths :param heights: list of row heights :param margins: either a scalar or a list of four numbers (l, r, t, b) :param dw: white space between subplots, horizontal :param dh: white space between subplots, vertical :param make_axes: bool; if True, create axes on the grid and return,

else return the gridspec.

labcore.analysis.mpl.fit_and_plot_1d(ds: Dataset, name: str, fit_class: Type[Fit], dim_order: List[int] | None = None, run_kwargs: Dict[str, Any] = {}) Tuple[Dataset, FitResult, Figure][source]#
labcore.analysis.mpl.format_ax(ax: Axes, top: bool = False, right: bool = False, xlog: bool = False, ylog: bool = False, xlabel: str | None = None, ylabel: str | None = None, xlim: Tuple[float, float] | None = None, ylim: Tuple[float, float] | None = None, xticks: int | List[float] = 3, yticks: int | List[float] = 3) None[source]#
labcore.analysis.mpl.format_right_cb(cb: Any) None[source]#
labcore.analysis.mpl.get_color_cycle(n: int, colormap: str | Colormap, start: float = 0.0, stop: float = 1.0, format: str = 'hex') List[str][source]#
labcore.analysis.mpl.pcolorgrid(xaxis: ndarray, yaxis: ndarray) Tuple[ndarray, ndarray][source]#
labcore.analysis.mpl.plot_fit_1d(ds: Dataset, name: str) Figure[source]#
labcore.analysis.mpl.setup_plotting(sns_style: str = 'whitegrid', rcparams: Dict[str, Any] = {}) None[source]#