Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/_static/vampire.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,10 @@ html[data-theme="dark"] {
div.cell_output table.dataframe {
font-size: 0.8rem;
}

/* Executed-cell figures: never wider than the content column, and scale the
height with the width so the aspect ratio holds on narrow screens. */
div.cell_output img {
max-width: 100%;
height: auto;
}
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
'c.InlineBackend.print_figure_kwargs = {"bbox_inches": "tight", "dpi": 300}\n'
)
os.environ["IPYTHONDIR"] = _ipython_dir
# Retina metadata displays figures at 150 CSS px per inch, so a 10-inch-wide
# figure would be 1500 px. Scale to 96 px per inch (the CSS inch); the PNGs
# keep their 300 dpi pixels (about 3x density). vampire.css caps the width at
# the content column and keeps the aspect ratio.
nb_render_image_options = {"scale": 64}

# -- sphinx-copybutton ---------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion docs/releases/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ files from earlier versions do not work with 1.0. See
`n_harmonics` Fourier low-pass (also in
{func}`~vampire.plotting.plot_summary`) removes pixel-level wiggle before
drawing; the filter is available as {func}`vampire.contours.lowpass_contour`.
- Documentation figures are rendered at 300 dpi.
- Documentation figures are rendered at 300 dpi, shown at 96 px per inch,
and shrink to fit narrow screens without changing their aspect ratio.
- {mod}`vampire.datasets`: bundled example images and a synthetic shape
generator.
- Method fixes: equidistant resampling without a duplicated endpoint, proper
Expand Down
Loading