Plotting#

Constants#

Some constants (colors, conversion factors, …) are provided at Constants.

Manipulate Figures and Axes#

make_me_nice([fig, fix_figwidth, ...])

Optimize whitespace in the figure.

add_abc([fig, xoffset_pts, yoffset_pts, ...])

Add labels to all suplots in fig.

set_axes_size(width_inch, height_inch[, ax, ...])

Set physical size of ax.

align_axes_vertically(ax, reference_ax[, ...])

Set horizontal position of ax relative to reference_ax.

align_axes_horizontally(ax, reference_ax[, ...])

Set horizontal position of ax relative to reference_ax.

get_column_pads_inches([fig])

Get distance between columns of axes in inches.

get_row_pads_inches([fig])

Get distance between rows of axes in inches.

set_min_column_pads(column_pad_pts[, fig])

Set the minimum distance between columns.

set_min_row_pads(ypads_pts[, fig])

Set the minimum distance between rows.

get_sorted_axes_grid([fig])

Get all axes from fig and sort them into a 2D grid.

get_figure_margins_inches([fig])

Get margins of the figure.

get_axes_position_inch([ax])

Get the bounding box of ax in inches, excluding labels, titles, etc.

get_axes_tightbbox_inch([ax, renderer])

Get bounding box of ax including labels in inches.

get_axes_margins_inches([ax, renderer])

Get left, right, top, bottom margins of ax.

get_renderer(fig)

Get the renderer of the fig.

square_polar_axes([ax, n_gridlines, mark_zero])

Format polar axes to be squared.

add_polar_guideline([ax, datapoints, ...])

Add a visual guideline to polar plots based on Ylm fits.

set_color_cycle(*colors[, nsteps, fig])

Set the color cycle in plots.

_set_theme_atompy([spines, spines_color, ...])

Sets a theme me likes.

set_latex_backend(font)

Enable a latex backend for rendering figures.

Colorbars#

add_colorbar(mappable[, ax, location, ...])

Add a colorbar to axes.

update_colorbars([fig])

Re-align colorbars to their parent axes.

clear_colorbars()

Clear reference to all colorbars that were created by add_colorbar().

cmap_from_x_to_y(cmap[, x, y, ...])

Return a colormap within (x,y) range

Plotting#

create_1d_plot(*datasets[, labels, ...])

Plot 1D dataset(s).

create_2d_plot(*data[, plot_kwargs, ...])

Plot 2D data.

dotted([linewidth, fontsize, ...])

Return a tuple to create a dotted line that fits perfectly into a legend.

dash_dotted([ratio, n_dashes, linewidth, ...])

Return a tuple to create a dash-dotted line that fits perfectly into a legend.

dashed([ratio, n_dashes, linewidth, ...])

Return a tuple to create a dashed line that fits perfectly into a legend.

textwithbox(axes, x, y, text[, pad, ...])

Plot text with matplotlib surrounded by a box using LaTeX commands.

ImshowData(image, extent)

Store an image with its extents, ready to be plotted with imshow.

PcolormeshData(x, y, c)

Store 2D data such that it can be plotted with pcolormesh

Miscellaneous#

Edges(left, right, top, bottom)

Wrapper for things that are at the left, right, top, bottom edge of something (e.g., the margins of a matplotlib.axes.Axes.

AliasError(keyword_arg, alias)

FigureWidthTooLargeError