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/perdictionaries, those will take precedence.- plot_function
"plot"or"step", default"plot" Use
matplotlib.pyplot.plot()ormatplotlib.pyplot.step()for plotting.- plot_kwargs_all
dict, optional Dictionary of keyword arguments passed to the plotting function.
- plot_kwargs_per
list[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_allandplot_kwargs_per,plot_kwargs_pertakes priority.- legend_kwargs
dict, optional Dictionary of keyword arguments passed to
matplotlib.pyplot.legend().- xlabel, ylabel, colorbar_label
str, optional Optional labels added to the x-axis / y-axis / colorbar.
- title
str, optional Optional title of the figure.
- xmin, xmax, ymin, ymax
float, optional Optionally fix the limits of the x/y axis.
- aspect_ratio
float, default 1.0 / golden ratio Aspect ratio (height/width) of the plot.
Ignored, if both
axes_width_inchandaxes_height_inchare provided.- axes_width_inch
float, optional, default 3.15 inch Physical width of the axes in inches. If not provided, it will be determined automatically.
- axes_height_inch
float, 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_kwargs
dict, optional Dictionary of keyword arguments passed to
make_me_nice().
- Returns:
- figure
matplotlib.figure.Figure - axes
matplotlib.axes.Axes
- figure
Examples