plot_step#
- Hist1d.plot_step(ax=None, fname=None, xlabel='__auto__', ylabel='__auto__', title='__auto__', logscale=False, xlim=None, ylim=None, start_at=0.0, savefig_kwargs={}, use_fixed_layout=None, fixed_layout_kwargs=None, make_me_nice=None, make_me_nice_kwargs=None, **plot_kwargs)[source]#
Plot the 1D histogram using
matplotlib.pyplot.plot.- Parameters:
- fname
str, optional If provided, the plot will be saved to this file using
matplotlib.figure.Figure.savefig().- xlabel
str, default “__auto__” Label for the x-axis.
If “__auto__”, use Hist1d.xlabel.
- ylabel
str, default “__auto__” Label for the y-axis.
If “__auto__”, use Hist1d.ylabel.
- title
str, default “__auto__” Title of the plot.
If “__auto__”, use Hist1d.title.
- logscalebool, optional
If True, use a logarithmic y scale.
- xlim
tuple[float|None,float|None], optional Limits for the x-axis.
- ylim
tuple[float|None,float|None], optional Limits for the y-axis.
- start_at
floator “auto”, default 0.0 Value at which the steps will start and end.
If “auto”, start (end) at first (last) value of Hist1d.values.
- savefig_kwargs
dict, optional Additional keyword arguments passed to
savefig().
- fname
- Returns:
tupleofmatplotlib.figure.Figure,matplotlib.axes.AxesA tuple containing the matplotlib Figure and Axes.
- Other Parameters:
- plot_kwargs
dict, optional Additional keyword arguments passed to
matplotlib.pyplot.plot.Should not contain the drawstyle keyword.
- use_fixed_layout
Deprecated since version 5.5.0: Does nothing.
- fixed_layout_kwargs
Deprecated since version 5.5.0: Does nothing.
- make_me_nice
Deprecated since version 5.5.0: Does nothing.
- make_me_nice_kwargs
Deprecated since version 5.5.0: Does nothing.
- plot_kwargs
Examples
import matplotlib.pyplot as plt import atompy as ap plt.style.use("atom") fig, axs = plt.subplots(1, 2, layout="compressed", figsize=(6.4, 3.0)) hist = ap.Hist1d((3, 1, 2, 3, 4), (0, 1, 2, 3, 4, 5)) axs[0].set_title("start_at = 0") hist.plot_step(ax=axs[0]) axs[1].set_title('start_at = "auto"') hist.plot_step(ax=axs[1], start_at="auto")
(
Source code,png,hires.png,pdf)