43 releases

0.0.43 Mar 23, 2024
0.0.41 Jan 17, 2024
0.0.39 Jul 16, 2023
0.0.37 Jun 7, 2020
0.0.0 Dec 4, 2014

#10 in Visualization

Download history 1126/week @ 2024-01-29 1296/week @ 2024-02-05 1935/week @ 2024-02-12 1707/week @ 2024-02-19 2178/week @ 2024-02-26 1667/week @ 2024-03-04 1339/week @ 2024-03-11 1553/week @ 2024-03-18 1303/week @ 2024-03-25 1630/week @ 2024-04-01 1148/week @ 2024-04-08 1382/week @ 2024-04-15 1357/week @ 2024-04-22 1280/week @ 2024-04-29 1047/week @ 2024-05-06 1196/week @ 2024-05-13

5,000 downloads per month
Used in 50 crates (46 directly)

LGPL-3.0

260KB
6.5K SLoC

RustGnuplot

A Gnuplot controller written in Rust.

Build Status

Documentation

On docs.rs

Examples

A simple example:

let mut fg = Figure::new();
fg.axes2d()
	.set_title("A plot", &[])
	.set_legend(Graph(0.5), Graph(0.9), &[], &[])
	.set_x_label("x", &[])
	.set_y_label("y^2", &[])
	.lines(
		&[-3., -2., -1., 0., 1., 2., 3.],
		&[9., 4., 1., 0., 1., 4., 9.],
		&[Caption("Parabola")],
	);
fg.show().unwrap();

Simple example plot

A somewhat involved 2D example (see example1.rs in the examples directory):

Complicated example plot

Features

  • Simple 2D plots
    • lines
    • points
    • points + lines
    • error bars
    • ...and more!
  • Simple 3D plots
    • surface plots
    • heatmaps
    • contours

Building

Via Cargo

cargo build

lib.rs:

A simple gnuplot controller.

Example

use gnuplot::{Figure, Caption, Color};

let x = [0u32, 1, 2];
let y = [3u32, 4, 5];
let mut fg = Figure::new();
fg.axes2d()
.lines(&x, &y, &[Caption("A line"), Color("black")]);
fg.show();

Dependencies

~2–10MB
~113K SLoC