#plot #latex

pgfplots

A Rust library to generate publication-quality figures

8 releases (4 breaking)

0.5.1 Jan 8, 2023
0.5.0 Jan 5, 2023
0.4.1 Dec 1, 2022
0.4.0 Jun 20, 2022
0.1.0 May 24, 2022

#106 in Visualization

Download history 10/week @ 2023-12-24 26/week @ 2024-01-07 1/week @ 2024-01-14 53/week @ 2024-02-18 56/week @ 2024-02-25 45/week @ 2024-03-03 29/week @ 2024-03-10 18/week @ 2024-03-17 15/week @ 2024-03-24

109 downloads per month
Used in qtruss

MIT license

56KB
1K SLoC

PGFPlots

Test Status Crates.io

A Rust library to generate publication-quality figures. This crate is a PGFPlots code generator, and provides utilities to create, customize, and compile high-quality plots.

Usage

Add the following to your Cargo.toml file:

[dependencies]
pgfplots = "0.5"

Plotting a quadratic function is as simple as:

use pgfplots::{axis::plot::Plot2D, Engine, Picture};

let mut plot = Plot2D::new();
plot.coordinates = (-100..100)
    .into_iter()
    .map(|i| (f64::from(i), f64::from(i*i)).into())
    .collect();

Picture::from(plot).show_pdf(Engine::PdfLatex)?;

Examples

A more extensive list of examples and their source code is available in the examples/ directory (runnable with cargo run --all-features --example example_name).

[code] [code] [code]

Features

  • Tectonic: Allow users to process the LaTeX code that generates figures without relying on any externally installed software, configuration, or resource files. This is achieved by including the tectonic crate as a dependency.

Dependencies

~2–18MB
~242K SLoC