Skip to main content

hwostyle

Matplotlib style sheets and utilities for HWO direct imaging figures.

Installation

pip install hwostyle

For development:

git clone https://github.com/HabitableWorldsObservatory/hwostyle.git
cd hwostyle
pip install -e ".[dev,test]"

Quick Start

import hwostyle

# Switch to paper mode (white background, muted colors)
hwostyle.use("light")

# Switch to talk mode (black background, neon colors)
hwostyle.use("dark")

# Access the palette
colors = hwostyle.palette
colors.cyan   # '#08F7FE' in dark, '#0097A7' in light

# Use domain-specific colormaps
cmap = hwostyle.cmaps.intensity   # PSF images
cmap = hwostyle.cmaps.residual    # difference maps
cmap = hwostyle.cmaps.phase       # wavefront error
cmap = hwostyle.cmaps.statistic   # signed statistics, SNR maps (Tol nightfall)

# Brand roles: name the entity, not the color
hwostyle.roles.planet
hwostyle.roles.positive           # certified claim

Modes

Feature Dark (Talks) Light (Papers) Barbie
Background Black White White
Colors Neon (high saturation) Muted (print-safe) RdPu pinks
Line width 2.5 1.5 1.0
Font Sans-serif Sans-serif Serif
Readout cmap magma magma magma
Intensity cmap Tol iridescent_r Tol iridescent_r RdPu

Paper mode (hwostyle.use("paper")) is the white-page mode for publications. Its default palette family is tol (Tol muted), and its curve roles follow that set (planet is indigo). The earlier Tol light set stays available as the tol-light family: hwostyle.use("paper", "tol-light"). Image colormaps are the same in every mode (see Image colormaps below).

Color Palette

Name Dark Light
Cyan #08F7FE #0097A7
Pink #FE53BB #C2185B
Yellow #F5D300 #F9A825
Green #00FF41 #2E7D32
Red #FF0000 #D32F2F
Purple #9467BD #7B1FA2

Roles

A role is what a plotted entity is; it resolves to one color per theme. Palette-backed roles follow the palette family; fixed roles keep their color in every family (paper and barbie use the light value).

Role Dark Light Use
star yellow yellow (#92924F in paper) stars
planet, measured, data cyan cyan planets, measured data
model, predicted pink #882255 model output, posterior draws
highlight pink pink emphasis text
reference green (#117733 in dark) #7A9F56 reference curves
zodi same as reference same local zodiacal light; never in a clip with reference, alert or posterior
disk #9251BD #6A1B9A disks
envelope purple purple envelopes (deprecated)
alert red #B71C1C (#C32D22 in paper) a wrong verdict, a warning
prior #9251BD #6A1B9A prior curves
positive #4C8DFF #1565C0 verdict: certified claim
negative #FF8C1A #E65100 verdict: rejected claim
posterior #B38A61 #662506 posterior curves (not model)
truth #9A9A9A #757575 scenery and true values

Motifs

hwostyle.motifs is the default table of recurring objects (star, planet, disk, detector, cue, and so on) as plain data. Each row names a color role or a neutral rank and the non-color channels (marker, line style, hatch, arrow style, font style) that keep it identifiable when the color is shared, dimmed or lost to color vision. motifs.motif_color(key, mode) resolves a row's color and motifs.motif_label_color(key, mode) the text color for its label (a lighter or deeper ink for the dark green and purple and the light green, whose marks are too faint to read as words); nothing in the table draws. A figure spends at most motifs.HUE_BUDGET (4) hues. motifs.SHARING_SETS lists hue pairs that never appear in the same clip (disk with prior, local_zodi with reference, alert or posterior), motifs.ACCEPTED_PAIRS lists the few co-occurring hues left under 10 dE on purpose, each with the channels that must differ, and motifs.EXCLUSION_PAIRS lists image roles that never share a figure. The cue is a ring, band or underlay in the text color and spends no hue. motifs.DIM_LEVELS gives the opacity of a finished step: 0.35 in dark mode and 0.5 in light and paper.

Image colormaps

Image roles use Paul Tol maps (through tol-colors), the same in light, dark and paper modes. For the sequential maps the page decides the orientation: low values sit at the page end.

Role Map Use
intensity Tol iridescent_r idealized model images, low = dark
readouts magma detector readouts and processed data
probability Tol YlOrBr (reversed on black) posterior and scatter density
pupil Tol WhOrBr (reversed on black) pupil transmission
mask two grays validity masks and binary apertures
opd Tol PRGn_r signed wavefront error
residual Tol BuRd difference images
statistic Tol nightfall_r signed statistics and SNR maps
phase twilight cyclic phase

Pupil and probability share their colors, so they never appear in the same figure. brand_intensity stays the brand ramp. cmaps.high_dynamic_range and roles.envelope are deprecated and warn; use intensity or readouts, and the parent series color for a band.

Barbie Palette

Name Hex
Blush #FAA6B7
Rose #F768A1
Magenta #D42A92
Berry #9A017B
Plum #5E006F

Metadata

Release files for hwostyle 1.7.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 hwostyle 1.7.0
File Size Uploaded Provenance Actions
hwostyle-1.7.0.tar.gz 30.5 kB With provenance Details for hwostyle-1.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 59.1 kB

Release files / hwostyle-1.7.0.tar.gz

Download URL hwostyle-1.7.0.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3f177694684e44447b7ca1bb58c0e4ae364f6a93e9b6fcde332675821fe9b73
BLAKE2b-256 checksum
How to use checksums
7bed9cff77605abedae27308dbc2801168d2b6e849916840dc06aac37f711381
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / hwostyle-1.7.0-py3-none-any.whl

Download URL hwostyle-1.7.0-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7706bfae0a6152e6e73b8d11561e93cb8a7062577094be6d306367e2efea10d
BLAKE2b-256 checksum
How to use checksums
880da4be13d394234c6b0db5e5a108659e0beaa7cbbbe457554e8c350c149fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for hwostyle 1.7.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hwostyle-1.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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.

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