Skip to main content

Crate solow_viz

Crate solow_viz 

Source
Expand description

§solow-viz

A dependency-light, general-purpose plotting backend that renders to SVG (with optional PNG raster export behind the png feature). It aims to be a small but genuinely useful, matplotlib-class engine: a Figure holding a grid of Axes, each carrying its own data, scales, limits, legend, and styling.

§Quick start

use solow_viz::Figure;
let mut fig = Figure::new(640, 480);
fig.axes().set_title("demo").plot(&[0.0, 1.0, 2.0, 3.0], &[0.0, 1.0, 4.0, 9.0]);
let svg = fig.to_svg();
assert!(svg.starts_with("<svg"));

§Subplots, legends, scales

use solow_viz::{Figure, Scale, LegendLoc, Color, Marker, LineStyle};
let mut fig = Figure::subplots(800, 600, 2, 2);
fig.suptitle("gallery");
let ax = fig.ax_at(0, 0).unwrap();
ax.set_yscale(Scale::Log);
ax.line(&[1.0, 2.0, 3.0], &[10.0, 100.0, 1000.0],
        Color::BLUE, 2.0, LineStyle::Dashed, Marker::Circle, 1.0, Some("series"));
ax.legend(LegendLoc::UpperLeft);
assert_eq!(fig.naxes(), 4);

The major capabilities:

Modules§

diagnostics
Ready-made diagnostic charts for common statistical evaluations.

Structs§

Annotation
A text annotation anchored at a data coordinate.
Axes
A single set of axes onto which series are drawn.
BoxStats
Five-number summary plus outliers for one boxplot box.
Color
An RGB color.
Figure
A figure: a pixel canvas holding a grid of Axes.
RefLine
A horizontal or vertical reference line spanning the axes.
RefSpan
A shaded band spanning the full opposite axis between lo and hi.
Spines
Which spines (frame edges) are drawn.
ViolinShape
A symmetric violin silhouette: density evaluated at sorted y grid points.

Enums§

Colormap
A sequential colormap mapping t in [0, 1] to a Color.
LegendLoc
Where to place the auto legend box within the axes frame.
LineStyle
Stroke dash pattern for lines.
Marker
Marker glyph drawn at scatter / line vertices.
Scale
The transform applied along an axis before mapping data to pixels.
Series
A drawable data series. Variants are additive; the original Line/Scatter/Bar shapes are preserved for backward compatibility.
StepWhere
How a step plot places its risers.
TickDirection
Direction tick marks point relative to the axis spine.