API reference

Everything is available at the top level of the package:

import plotastro as pa

The reference is split by topic into the pages below, grouped in three sets. Each table lists everything a page documents. The guides (Quickstart, Colours, Markers, line styles and panel labels, Author lists from a CSV) show the same features in use.

Figures

Styles and figure sizes

name

what it does

set_style(), use()

activate a journal’s style, optionally with a palette, colormap, LaTeX or rcParams

current_journal()

the journal of the last set_style call

figsize()

figure dimensions matching a journal’s column or text width

subplots()

plt.subplots with that size computed for you

savefig()

save a figure in several formats at once

JOURNALS, GOLDEN, STYLE_DIR

journal widths, the default aspect ratio, the .mplstyle files

set_size()

deprecated form of figsize, from the original API

Markers, line styles and panel labels

name

what it does

MARKERS, LINESTYLES

marker sequence and named dash patterns

style_cycler()

a property cycle pairing colours with markers and/or dashes

label_panels()

(a), (b), (c) panel labels

show_markers(), show_linestyles()

reference charts of the markers and dash patterns

Colours

Palettes and colour tools

name

what it does

COLORS, CYCLE

the default colour-blind-friendly cycle, by name and in order

OKABE_ITO, PETROFF8, PETROFF10, TOL_VIBRANT, PAIRED

more palettes

euclid_colors()

the Euclid niceplots colour schemes, by name

lighten(), darken()

matched shades without transparency

show_colors()

swatch chart of a palette

CMasher colours and colormaps (optional cmasher package)

name

what it does

cmasher_colors()

n discrete colours sampled from a CMasher colormap

cmasher_cmap()

a CMasher colormap, optionally cut or split into levels

Colour-vision-deficiency checks

name

what it does

simulate_cvd()

how colours look with a colour-vision deficiency, or in greyscale

check_colors()

a palette next to its simulations

check_figure()

a whole rendered figure next to its simulations

LaTeX output

Author lists

name

what it does

authorlist()

LaTeX author/affiliation block for a journal, from a CSV file

plotastro-authors

the same from the command line

Package

pa.__version__ is the installed version, as a string. Importing plotastro also registers its styles with matplotlib, so plt.style.use("mnras") works anywhere afterwards (see With plain matplotlib).