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.
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, all four spines hidden, and the
ggplot2 default qualitative palette.
Sourcepub fn publication() -> Self
pub fn publication() -> Self
Publication-ready theme: crisp, minimal, and suitable for print.
- Pure white background, no grid.
- All four spines visible but thin (0.5 px) in near-black.
- Inward ticks for a compact footprint.
- Serif font family for journal aesthetics.
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