ScatterPlot
Builder for creating scatter plots from (x, y) data. Supports error bars, trend lines, confidence bands, variable point sizes (bubble plots), and six marker shapes.Constructor
Create a scatter plot with default settings.Defaults:
- Color:
"black" - Size:
3.0pixels - Marker:
MarkerShape::Circle - No trend line
- No legend label
Data Methods
(T, U) pairs where T and U implement Into<f64>, so integer and float types all work without casting.Example:with_data.(negative_arm, positive_arm) tuple. Must be called after with_data.with_data.(negative_arm, positive_arm) tuple. Must be called after with_data.Styling Methods
"steelblue", "#4477aa").3.0). For per-point radii use with_sizes.MarkerShape::Circle).size value from with_size is ignored.Example:Trend Line Methods
TrendLine for available options."black").1.0).with_trend.with_trend.Band & Legend Methods
y_lower and y_upper must have the same length as the data. The band color matches the scatter series color.Example:Enums & Types
MarkerShape
Marker shape used to render individual scatter points. Default isCircle.
Circle- Circular markers (default)Square- Square markersTriangle- Triangle markersDiamond- Diamond markersCross- Cross markersPlus- Plus sign markers
TrendLine
Trend line variant to overlay on a scatter plot.Linear- Ordinary least-squares linear fit: y = mx + b
ScatterPoint
A single (x, y) data point with optional asymmetric error bars. Fields:x: f64- X coordinatey: f64- Y coordinatex_err: Option<(f64, f64)>- X error bars as (negative_half, positive_half)y_err: Option<(f64, f64)>- Y error bars as (negative_half, positive_half)