Crate plotpy[][src]

Expand description

Rust plotting library using Python (Matplotlib)

This library generates plots by calling python3 after generating a python script. The name of the python script is based on the name of the figure (png, svg, …). If an error occurs, a log file is created (also named as the figure).

The main idea here is to create objects such as Curve, Contour, Histogram, or Surface and add it to a plot using the add command. The plot may also configured using the methods of Plot.

Each object (e.g. Curve, Legend, Text) defines a number of configuration options that can be directly set on the object. Then, the draw method of each object must be called before adding to Plot.


use russell_lab::generate3d;
let mut surface = Surface::new();

// draw surface
let n = 9;
let (x, y, z) = generate3d(-2.0, 2.0, -2.0, 2.0, n, n, |x, y| x * x + y * y);
surface.draw(&x, &y, &z);

// add surface to plot
let mut plot = Plot::new();

// save figure"/tmp/plotpy/example_main.svg"))?;



Generates a contour plot

Generates a curve (aka line-plot) given two arrays (x,y)

Generates a Histogram plot

Generates a Legend

Driver structure that calls Python

Draw polygonal shapes

Generates a 3D a surface (or wireframe, or both)

Creates text to be added to a plot



Defines a trait to handle Matrix-like data

Defines a trait to handle Vector-like data