pub struct FigureState {Show 30 fields
pub xlabel: Option<String>,
pub ylabel: Option<String>,
pub zlabel: Option<String>,
pub title: Option<String>,
pub legend: Vec<String>,
pub xlim: Option<(f64, f64)>,
pub ylim: Option<(f64, f64)>,
pub zlim: Option<(f64, f64)>,
pub grid: bool,
pub colormap: Option<ColormapSpec>,
pub colorbar: bool,
pub subplot: Option<(u32, u32, u32)>,
pub hold: bool,
pub pending_series: Vec<PendingSeries>,
pub panels: Vec<Panel>,
pub annotations: Vec<(f64, f64, String)>,
pub theme: Option<Theme>,
pub bg_color: Option<StyleColor>,
pub font_size: Option<u32>,
pub line_width: Option<f32>,
pub marker_size: Option<u32>,
pub grid_color: Option<StyleColor>,
pub grid_width: Option<f32>,
pub axis_mode: Option<AxisMode>,
pub figure_size: Option<(u32, u32)>,
pub active_yaxis: YAxis,
pub right_pending_series: Vec<PendingSeries>,
pub right_ylim: Option<(f64, f64)>,
pub right_ylabel: Option<String>,
pub clabel: bool,
}Expand description
Per-figure annotation and accumulation state.
Annotations (xlabel, title, …) are set via their corresponding
functions and consumed at the next render call (or at hold('off') /
savefig when in accumulating mode).
Fields§
§xlabel: Option<String>X-axis label.
ylabel: Option<String>Y-axis label.
zlabel: Option<String>Z-axis label (consumed only by plot3 / scatter3).
title: Option<String>Chart title.
legend: Vec<String>Series labels for legend boxes (file export only).
xlim: Option<(f64, f64)>Override x-axis range [min, max].
ylim: Option<(f64, f64)>Override y-axis range [min, max].
zlim: Option<(f64, f64)>Override z-axis range [min, max] (3D only).
grid: boolWhether to draw grid lines (file export only; ASCII ignores).
colormap: Option<ColormapSpec>Active colormap for imagesc (default ColormapSpec::Named("viridis") when None).
colorbar: boolWhether to append a colorbar to the next imagesc render.
subplot: Option<(u32, u32, u32)>Active subplot grid position (rows, cols, index_1based).
hold: boolWhen true, plot calls accumulate into Self::pending_series.
pending_series: Vec<PendingSeries>Series accumulated for the current in-progress panel.
panels: Vec<Panel>Committed panels waiting for savefig.
annotations: Vec<(f64, f64, String)>Text annotations accumulated for the current render (flushed at render time).
theme: Option<Theme>Active colour theme (None means use the light default).
bg_color: Option<StyleColor>Per-figure background colour override (beats the theme background).
font_size: Option<u32>Title and axis-label font size override in points (minimum 8).
line_width: Option<f32>Stroke width override for all line series (pixels).
marker_size: Option<u32>Marker radius override for scatter / marker series (pixels).
grid_color: Option<StyleColor>Grid line colour override (applied to both bold and light grid lines).
grid_width: Option<f32>Grid line stroke width override in pixels.
axis_mode: Option<AxisMode>Axis display mode (axis('equal'), axis('tight'), axis('off')).
figure_size: Option<(u32, u32)>Output canvas size in pixels (width, height) for file export.
None falls back to the default 800×600. Set via figure(w, h).
Persists across panels; cleared only when the whole state is reset.
active_yaxis: YAxisWhich Y axis receives new series and annotation calls.
right_pending_series: Vec<PendingSeries>Series accumulated for the right (secondary) Y axis.
right_ylim: Option<(f64, f64)>Override for the right Y axis range.
right_ylabel: Option<String>Label for the right Y axis.
clabel: boolWhen true, the next contour render places a text label at each level.
Implementations§
Source§impl FigureState
impl FigureState
Sourcepub fn canvas_size(&self) -> (u32, u32)
pub fn canvas_size(&self) -> (u32, u32)
Returns the canvas size in pixels, falling back to 800×600 if not set.
Sourcepub fn resolve_theme(&self) -> Theme
pub fn resolve_theme(&self) -> Theme
Returns the resolved active Theme: explicit theme field > light default.
Sourcepub fn effective_bg_rgb(&self) -> (u8, u8, u8)
pub fn effective_bg_rgb(&self) -> (u8, u8, u8)
Returns the effective background colour as an RGB triple.
Resolution order: explicit bg_color override > active theme background.
Sourcepub fn push_series(&mut self, series: PendingSeries)
pub fn push_series(&mut self, series: PendingSeries)
Pushes series to the left or right pending queue based on Self::active_yaxis.
Trait Implementations§
Source§impl Clone for FigureState
impl Clone for FigureState
Source§fn clone(&self) -> FigureState
fn clone(&self) -> FigureState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more