pub struct Theme {Show 24 fields
pub figure_background: Color,
pub axes_background: Color,
pub grid_color: Color,
pub grid_width: f64,
pub show_grid: bool,
pub spine_color: Color,
pub spine_width: f64,
pub show_top_spine: bool,
pub show_right_spine: bool,
pub show_bottom_spine: bool,
pub show_left_spine: bool,
pub tick_color: Color,
pub tick_length: f64,
pub tick_direction: TickDirection,
pub tick_label_size: f64,
pub axis_label_size: f64,
pub title_size: f64,
pub title_weight: FontWeight,
pub text_color: Color,
pub line_width: f64,
pub marker_size: f64,
pub marker_alpha: f64,
pub color_cycle: Vec<Color>,
pub font_family: Option<String>,
}Expand description
Visual theme controlling all rendering defaults.
Every visual parameter that a renderer or layout engine might need lives here. Chart builders read from the active theme to fill in any value the user did not override explicitly.
Fields§
§figure_background: ColorBackground color for the entire figure (outside the axes area).
axes_background: ColorBackground color for the axes face (the data-drawing region).
grid_color: ColorColor of major grid lines.
grid_width: f64Width (in px) of major grid lines.
show_grid: boolWhether the grid is shown by default (line/scatter: true; bar/hist: false).
spine_color: ColorColor of visible axis spines.
spine_width: f64Width (in px) of axis spines.
show_top_spine: boolWhether the top spine is drawn.
show_right_spine: boolWhether the right spine is drawn.
show_bottom_spine: boolWhether the bottom spine is drawn.
show_left_spine: boolWhether the left spine is drawn.
tick_color: ColorColor of tick marks and tick labels.
tick_length: f64Length (in px) of major tick marks.
tick_direction: TickDirectionDirection ticks extend from the spine.
tick_label_size: f64Font size (in pt) for tick labels.
axis_label_size: f64Font size (in pt) for axis labels.
title_size: f64Font size (in pt) for the plot title.
title_weight: FontWeightFont weight for the plot title.
text_color: ColorColor used for all text (titles, labels, tick labels).
line_width: f64Default line width (in px) for line plots.
marker_size: f64Default marker diameter (in px) for scatter plots.
marker_alpha: f64Default marker opacity (0.0 = fully transparent, 1.0 = fully opaque).
color_cycle: Vec<Color>Categorical color cycle used when the user does not specify colors.
font_family: Option<String>Optional font family override. None means the renderer picks its
built-in default (typically a clean sans-serif such as Helvetica).
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn dark() -> Self
pub fn dark() -> Self
Dark theme with a near-black background and bright, neon-ish data colors.
Suited for dashboards and presentations on dark backgrounds.
Sourcepub fn seaborn() -> Self
pub fn seaborn() -> Self
Seaborn-inspired theme with a tinted axes background and white grid.
Mimics the popular seaborn "whitegrid" aesthetic: a pale blue-grey
axes face (#EAEAF2) with white grid lines over it. Top and right
spines are hidden for the characteristic despined look. Grid lines
are slightly thicker than default for visual weight against the
tinted background. Uses a muted color palette via Tableau-10 and a
sans-serif font family.
Sourcepub fn ggplot() -> Self
pub fn ggplot() -> Self
ggplot2-inspired theme with a grey panel and white grid.
Reproduces the characteristic look of R’s ggplot2: a medium-grey panel
(#E5E5E5), white major grid lines, a thin panel border around all
four sides, and the ggplot2 default qualitative palette. The title is
rendered bold in the classic ggplot2 aesthetic.
Sourcepub fn publication() -> Self
pub fn publication() -> Self
Publication-ready theme: crisp, minimal, and suitable for print.
Designed for journal submissions and academic papers at 300+ DPI:
- Pure white background, no grid by default.
- All four thin black spines (0.5 px) for a complete panel frame.
- Inward ticks for a compact footprint that does not intrude on margins.
- Larger axis labels (12 pt) for readability at reduced figure sizes.
- Serif font family for traditional academic aesthetics.
Sourcepub fn nature() -> Self
pub fn nature() -> Self
Nature/Science journal theme: ultra-clean and compact.
Inspired by the house style of top scientific journals such as Nature and Science:
- White background with no unnecessary decoration.
- Bold axis labels for immediate readability in multi-panel figures.
- Thin spines (0.75 px) on bottom and left only; top and right hidden.
- Compact font sizes suited for narrow column widths.
- Sans-serif font family (Helvetica/Arial style) per journal guidelines.
Sourcepub fn solarized() -> Self
pub fn solarized() -> Self
Solarized dark theme based on the Solarized color scheme by Ethan Schoonover.
Uses the base03 background (#002B36) with Solarized content tones
for text (#839496) and accent colors for data series. The result is
a low-contrast, eye-friendly palette designed for extended viewing.
This is the dark variant. A light variant could be built by swapping base03/base0 roles.
Trait Implementations§
Source§impl Default for Theme
impl Default for Theme
Source§fn default() -> Self
fn default() -> Self
Returns the canonical default theme matching the Visual Design Brief.
- Background:
#FFFFFF, axes face:#FFFFFF - Grid:
#E6E6E6, 1 px, shown by default - Spines:
#333333, 1 px, top + right hidden (despine look) - Ticks: outward, 4 px,
#333333 - Font sizes: title 14 pt bold, axis labels 11 pt, tick labels 9 pt
- Text color:
#333333 - Line width 1.5 px, marker 6 px diameter, marker alpha 0.8
- Tableau-10 color cycle