atompy.create_1d_plot#

atompy.create_1d_plot(*datasets, labels=None, plot_function='plot', plot_kwargs_all={}, plot_kwargs_per=None, legend_kwargs={}, xlabel=None, ylabel=None, title=None, xmin=None, xmax=None, ymin=None, ymax=None, aspect_ratio=0.6180339887502366, axes_width_inch=3.1496062992125986, axes_height_inch=None, make_me_nice=True, make_me_nice_kwargs={'fix_figwidth': False})[source]#

Plot 1D dataset(s).

Parameters:
*datasets((x1s, y1s), (x2s, y2s), …)

One or many dataset(s) to be plotted.

Each dataset must be composed of two arrays x and y.

labelsarray_like, optional

Labels of each dataset. Length must match the amounts of datasets passed.

If labels are also passed in the plot_kwargs_all/per dictionaries, those will take precedence.

plot_function"plot" or "step", default "plot"

Use matplotlib.pyplot.plot() or matplotlib.pyplot.step() for plotting.

plot_kwargs_alldict, optional

Dictionary of keyword arguments passed to the plotting function.

plot_kwargs_perlist[dict], optional

List of dictionaries of keyword arguments passed to the plot function. len(plot_kwargs_per) must be equal to the amount of datasets passed.

Each dictionary corresponds to the respective datasets.

If the same keyword is provided in plot_kwargs_all and plot_kwargs_per, plot_kwargs_per takes priority.

legend_kwargsdict, optional

Dictionary of keyword arguments passed to matplotlib.pyplot.legend().

xlabel, ylabel, colorbar_labelstr, optional

Optional labels added to the x-axis / y-axis / colorbar.

titlestr, optional

Optional title of the figure.

xmin, xmax, ymin, ymaxfloat, optional

Optionally fix the limits of the x/y axis.

aspect_ratiofloat, default 1.0 / golden ratio

Aspect ratio (height/width) of the plot.

Ignored, if both axes_width_inch and axes_height_inch are provided.

axes_width_inchfloat, optional, default 3.15 inch

Physical width of the axes in inches. If not provided, it will be determined automatically.

axes_height_inchfloat, optional

Physical height of the axes in inches. If not provided, it will be determined automatically.

make_me_nicebool, default True

Optimize white space in the figure. See docstring of make_me_nice() for details.

make_me_nice_kwargsdict, optional

Dictionary of keyword arguments passed to make_me_nice().

Returns:
figurematplotlib.figure.Figure
axesmatplotlib.axes.Axes

Examples