Skip to main content

graphpaper

Make printable graph paper as PDF or SVG from Python or the command line: square grids, dot grids, lined and handwriting paper, isometric and hexagon grids, semi-log and log-log paper, and music staff / guitar tab paper.

  • Exact size. Whole cells are fitted inside the margin and centred, so a 1/4 inch grid measures 1/4 inch when printed at 100% ("Actual size", not "Fit to page").
  • Small files. Pure vector output. Multi-page PDFs share one content stream, so a 100-page notebook is barely bigger than one page.
  • No dependencies. Pure Python 3.8+.
pip install graphpaper

Command line

graphpaper grid --spacing 0.25in --major 4 -o quarter-inch.pdf
graphpaper grid --spacing 5mm --size a4 --major 2 -o 5mm.pdf
graphpaper dot --spacing 5mm --size a4 --pages 50 -o dot-notebook.pdf
graphpaper lined --spacing 0.75in --midline --header --no-margin-line -o handwriting.pdf
graphpaper isometric --spacing 0.5in -o iso.svg
graphpaper hex --spacing 0.577in -o one-inch-hexes.pdf      # 1 in across the flats
graphpaper staff --spacing 2mm --staves 12 -o staff.pdf
graphpaper staff --spacing 2.5mm --staves 8 --tab -o guitar-tab.pdf
graphpaper semilog --cycles 3 -o semi-log-3-cycle.pdf
graphpaper semilog --cycles 4 --log-x --landscape -o bode.pdf   # log frequency axis
graphpaper loglog --cycles-x 3 --cycles 5 -o log-log.pdf

Run graphpaper --help for every option. The output format follows the file extension (.pdf or .svg).

Python

import graphpaper

graphpaper.save("quarter-inch.pdf", "grid", spacing="0.25in", major=4)
graphpaper.save("dots.pdf", "dot", spacing="5mm", size="a4", pages=50)

data = graphpaper.pdf("lined", spacing="0.28125in", header=True)   # bytes
svg = graphpaper.svg("isometric", spacing="0.5in", color="#999999")  # str

page = graphpaper.layout("grid", spacing="1cm", size="a4")
print(page.info)   # {'columns': 19, 'rows': 28}

Lengths are strings with a unit ("5mm", "0.25in", "1cm", "18pt") or plain numbers in inches.

Kind spacing means Useful options
grid square size major (every Nth line bold), border, header
dot distance between dots major (bigger dot every Nth), dot_size
lined line gap (college ruled = 9/32 in, wide = 11/32 in) midline, margin_line, header
isometric triangle side major, border
isodot triangle side dot_size
hex hexagon side (across the flats = side × √3)
staff gap between staff lines staves, staff_lines=6 (TAB), grand
semilog square size on the linear axis cycles (1–6 decades), log_axis="x", labels
loglog not used cycles (vertical), cycles_x (horizontal), labels

Common options: size (letter, a4, legal, tabloid, a3, a5 or a (width, height) tuple), landscape, margin, color, major_color, weight, major_weight (points).

Notes

  • Isometric lines all pass through one lattice point at the centre of the page, so the vertical lines meet the diagonals exactly on every page size.
  • Hexagon edges shared by two cells are drawn once, which keeps lines even and files small.
  • Log paper draws the 2…9 lines in every decade and adds finer subdivisions (1–2 by 0.1, 2–5 by 0.2, 5–10 by 0.5) only where a decade is long enough to keep them at least 2.2 pt apart, so many cycles on a small page never print as a grey smear. graphpaper.core.log_ticks(decade_len) returns the positions if you want them for your own plots.
  • For e-ink tablets, set size to the screen size, e.g. reMarkable 2: size=("6.212in", "8.283in").

This package is the Python counterpart of the browser generator at https://graphpaperpdf.net/, which also has coordinate planes, polar paper, Cornell notes and engineering pads.

License

MIT

Metadata

Release files for graphpaper 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphpaper 0.2.0
File Size Uploaded Provenance
graphpaper-0.2.0.tar.gz 14.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for graphpaper 0.2.0
File Interpreter ABI Platform
graphpaper-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / graphpaper-0.2.0.tar.gz

Download URL graphpaper-0.2.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8a3f7d6beccd7cdf16f6815a8451fa80af4d4d7b49c28fcd472b78c865385751
BLAKE2b-256 checksum
How to use checksums
251f34d54b754b36ce96d733dd2ea694f0af9119e6c6cc90a6a4a193ee853195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / graphpaper-0.2.0-py3-none-any.whl

Download URL graphpaper-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a2fa1a6f86147749fe966966e4653e9cb44761507f0c80f3abc2d3b8d31f1ef
BLAKE2b-256 checksum
How to use checksums
3026b26eddce5b183ecbc23cecbff8054ade49aa75086ebc8ecefaa1bfa10b4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Security for graphpaper 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page