44 releases

0.0.44 Oct 31, 2024
0.0.43 Mar 23, 2024
0.0.42 Feb 18, 2024
0.0.39 Jul 16, 2023
0.0.0 Dec 4, 2014

#27 in Visualization

Download history 1063/week @ 2024-07-28 1133/week @ 2024-08-04 994/week @ 2024-08-11 754/week @ 2024-08-18 1357/week @ 2024-08-25 1066/week @ 2024-09-01 817/week @ 2024-09-08 735/week @ 2024-09-15 1081/week @ 2024-09-22 852/week @ 2024-09-29 627/week @ 2024-10-06 1119/week @ 2024-10-13 958/week @ 2024-10-20 1253/week @ 2024-10-27 1013/week @ 2024-11-03 496/week @ 2024-11-10

3,812 downloads per month
Used in 50 crates (46 directly)

LGPL-3.0

265KB
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

~1.7–9.5MB
~113K SLoC