Expand description
A simple library to quickly plot data using egui_plot.
§Usage
Add plot_starter to your Cargo.toml:
[dependencies]
plot_starter = "0.34"Then, use it in your code:
use plot_starter::{Plotter, Chart, Color, arange};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let plotter = Plotter::new();
Chart::on(&plotter)
.data(arange(-10.0 .. 10.0, 0.1).map(|x| (x, x.sin())))
.color(Color::RED);
plotter.present()
}§Running the Example
To run the included demo, clone the repository and run:
cargo run --example demoStructs§
- ARange
- Data structure to be used by
arange() - Chart
- Represents a chart to be plotted.
- Color
- color of line This format is used for space-efficient color representation (32 bits).
- Plotter
- The main struct for creating and managing plots.
Functions§
- arange
- Create f64 stream with step within range.