Skip to main content

PlottersExt

Trait PlottersExt 

Source
pub trait PlottersExt: Plot {
    // Required methods
    fn plot(&self);
    fn save(&self, path: &str);
    fn to_svg(&self) -> String;
}
Expand description

Plotters rendering extension trait. Provides static image output methods.

Available on all types implementing the core Plot trait via blanket impl.

Required Methods§

Source

fn plot(&self)

Render and display the plot.

In Jupyter/evcxr: displays inline PNG. Otherwise: writes a temp PNG and opens the OS image viewer.

Source

fn save(&self, path: &str)

Save the plot to a file. Format inferred from extension:

  • .png -> BitMapBackend
  • .svg -> SVGBackend
Source

fn to_svg(&self) -> String

Render the plot to an SVG string (in-memory, no file I/O).

Implementors§

Source§

impl<T: Plot> PlottersExt for T