Overview
Theme controls all non-data visual elements of a plot:
- Background, axes, grid, tick marks
- Text and legend styling
- Plot-specific chrome (box medians, violin borders, etc.)
Palette, which controls data element colors.
Usage
Built-in Themes
Theme::light()
Light background theme (default).
- Background: white
- Axes/ticks: black
- Grid: #ccc
- Text: black
- Shows grid by default
Theme::dark()
Dark background theme.
- Background: #1e1e1e
- Axes/ticks: #cccccc
- Grid: #444444
- Text: #e0e0e0
- Shows grid by default
Theme::minimal()
Minimal theme with no grid and serif font.
- Background: white
- Axes/ticks: black
- Grid: hidden
- Text: black
- Font: serif
- Legend: no border
Theme::solarized()
Solarized light theme.
- Background: #fdf6e3
- Axes/ticks: #586e75
- Grid: #eee8d5
- Text: #657b83
- Shows grid by default
Custom Themes
Create a custom theme by modifying fields:Fields
Background color
Color of axis lines
Color of grid lines
Color of tick marks
Color of all text (labels, titles, ticks)
Legend background color
Legend border color (use “none” for no border)
Color of pie chart leader lines
Color of box plot median line
Color of violin plot outline
Color of colorbar border
Font family (e.g., “serif”, “sans-serif”, “monospace”)
Whether to show grid lines by default
Source
src/render/theme.rs