Crates.io | pgfplots |
lib.rs | pgfplots |
version | 0.5.1 |
source | src |
created_at | 2022-05-24 01:41:12.527931 |
updated_at | 2023-01-08 08:56:28.690774 |
description | A Rust library to generate publication-quality figures |
homepage | |
repository | https://github.com/DJDuque/pgfplots |
max_upload_size | |
id | 592372 |
size | 138,902 |
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.
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)?;
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] |
---|---|---|