Skip to content
NaNIsaacPublic

About

Origin-like publication style for matplotlib, with colour-vision-deficiency-safe cycles

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

qoraplot

English | 한국어

An Origin-like publication style for matplotlib (box): ticks inside on all four sides with minor ticks, a closed frame, no grid and a sans-serif face, sized for journal columns, slides and posters. The colour, marker and dash cycle comes from cvdkit, so series stay apart with colour-vision deficiency.

qoraplot is not affiliated with OriginLab; "Origin-like" only describes the look.

Style preview

box — publication frame house — lighter layout
Origin-like box style House style

Both variants use cvdkit for color, marker and dash cycles. See the deuteranopia comparison.

Install

qoraplot needs Python 3.12 or newer. Until the first release is on PyPI, install it from a clone of this repository:

uv venv
uv pip install .
uv venv
uv pip install .

Check that it imports:

uv run --no-project python -c "import qoraplot; print(qoraplot.VARIANTS)"
uv run --no-project python -c "import qoraplot; print(qoraplot.VARIANTS)"

Use

import matplotlib.pyplot as plt
import numpy as np
import qoraplot

qoraplot.use("box", "paper")  # variant "box" or "house"; context "paper", "slide" or "poster"

fig, ax = qoraplot.figure("single")  # 3.5 in wide; "double" is 7.2 in
x = np.linspace(0, 10, 30)
for tau in (1, 2, 4):
    ax.plot(x, np.exp(-x / tau), label=f"tau = {tau}")
ax.set_xlabel("time (ns)")
ax.legend()
qoraplot.panel_label(ax, "a")
fig.savefig("figure.pdf")  # 300 dpi for paper, TrueType fonts embedded

with qoraplot.style("house", "poster"):  # only inside the block; save inside it too
    fig, ax = qoraplot.figure(14.4, aspect=0.5)
    ax.plot(x, np.sin(x))
    fig.savefig("poster_panel.png")

Fonts are looked up when a figure is drawn, so with style(...) call savefig inside the block.

Variants

Two variants on the same data. There is no default yet: name the variant in every call until one is chosen.

  • box: closed frame, ticks inside on all four sides, minor ticks, no grid, Arial or Helvetica (falling back to Liberation Sans, then DejaVu Sans), black ink.
  • house: open L frame, grey axes and ticks, near-black text, light grid, IBM Plex Sans (bundled) with STIX math, ticks inside.

box:

box variant

house:

house variant

Both as seen with deuteranopia (cvdkit simulation): docs/variants_deutan.png. The figures are drawn by examples/variants.py.

License

MIT. IBM Plex Sans is bundled under the SIL Open Font License 1.1 (src/qoraplot/fonts/OFL.txt).

About

Origin-like publication style for matplotlib, with colour-vision-deficiency-safe cycles

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages