46 releases

0.0.46 Apr 20, 2025
0.0.45 Feb 9, 2025
0.0.44 Oct 31, 2024
0.0.43 Mar 23, 2024
0.0.0 Dec 4, 2014

#40 in Visualization

Download history 3005/week @ 2025-05-18 4701/week @ 2025-05-25 5351/week @ 2025-06-01 3138/week @ 2025-06-08 1662/week @ 2025-06-15 3375/week @ 2025-06-22 2848/week @ 2025-06-29 5285/week @ 2025-07-06 5706/week @ 2025-07-13 5050/week @ 2025-07-20 4109/week @ 2025-07-27 3178/week @ 2025-08-03 2791/week @ 2025-08-10 2578/week @ 2025-08-17 4009/week @ 2025-08-24 3777/week @ 2025-08-31

13,304 downloads per month
Used in 62 crates (52 directly)

LGPL-3.0

285KB
7K 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".into())]);
fg.show();

Dependencies

~2–14MB
~139K SLoC