plot::theme
On this page
Themes: colours, sizes and the colour cycle. light and dark use
the Nabi docs site's tokens, so a figure sits on its pages.
Structs
ThemeSource
pub struct ThemeHow a figure looks: colours, type sizes, line widths, the series
colour cycle and the default colormap. Every field is public; start
from light() or dark() and change what you need.
use plot::Theme;
let t = Theme::dark();
t.font_size = 13.0;
let svg = try plot::line([0.0, 1.0], [1.0, 0.0]).theme(t).svg();
assert(svg.contains("#141114"));
The figure background; transparent to let the page show.
The plot area background.
Titles, labels and text.
Tick labels and legend text.
Axis lines and ticks.
Grid lines.
Legend and colorbar frames.
The CSS font stack written into SVG output.
Tick labels, legend and text, in px.
Axis titles, in px.
Axes titles, in px.
Lines, in px.
Marker diameter, in px.
Axis line width, in px.
Grid line width, in px.
Tick length, in px.
Grid lines at the major ticks.
Draw the top and right axis lines too (a full box).
Series colours, used in turn.
The colormap for heatmaps, contours and colour-by-value.
Light: the docs site's light tokens, Okabe-Ito series colours.
nabiassert(plot::Theme::light().show_grid);Dark: the docs site's dark tokens; the cycle's black becomes the ink colour.
nabiassert(plot::Theme::dark().background == plot::Color::rgb(20, 17, 20));The same theme on a transparent background.
nabiassert(plot::Theme::light().transparent().background.a == 0);Series colour
i, wrapping around the cycle.nabiassert(plot::Theme::light().series(0) == plot::Color::rgb(0, 114, 178));