pub trait DataFramePlotExt {
// Required method
fn plot(&self) -> DfPlot<'_>;
}Expand description
Adds a pandas/seaborn-style .plot() accessor to a Polars DataFrame.
The terminal methods return a Figure; save it via the umbrella crate’s
FigureExt (use plotkit::prelude::*; then fig.save("out.png")?).
use plotkit_polars::DataFramePlotExt;
use plotkit_polars::polars::prelude::*;
let df = DataFrame::new(vec![
Series::new("x".into(), &[1.0, 2.0, 3.0]).into(),
Series::new("y".into(), &[1.0, 4.0, 9.0]).into(),
])
.unwrap();
let fig = df.plot().line("x", "y").unwrap();
assert_eq!(fig.num_axes(), 1);Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".