Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djduque/pgfplots
PGFPlots code generator
https://github.com/djduque/pgfplots
Last synced: 26 days ago
JSON representation
PGFPlots code generator
- Host: GitHub
- URL: https://github.com/djduque/pgfplots
- Owner: DJDuque
- License: mit
- Created: 2022-04-15T08:45:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T16:50:46.000Z (over 1 year ago)
- Last Synced: 2024-11-17T16:05:44.018Z (26 days ago)
- Language: Rust
- Homepage:
- Size: 96.7 KB
- Stars: 120
- Watchers: 2
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - djduque/pgfplots - quality figures. [![build](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml) (Libraries / Data visualization)
- awesome-rust-cn - djduque/pgfplots
- awesome-rust - djduque/pgfplots - Library to generate publication-quality figures. [![build](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml) (Libraries / Data visualization)
- fucking-awesome-rust - djduque/pgfplots - Library to generate publication-quality figures. [![build](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml) (Libraries / Data visualization)
- fucking-awesome-rust - djduque/pgfplots - Library to generate publication-quality figures. [![build](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml) (Libraries / Data visualization)
README
# PGFPlots
[![Test Status](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml)
[![Crates.io](https://img.shields.io/crates/v/pgfplots?labelColor=383f47)](https://crates.io/crates/pgfplots)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:
```toml
[dependencies]
pgfplots = "0.5"
```Plotting a quadratic function is as simple as:
```rust
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](https://github.com/DJDuque/pgfplots/tree/main/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]](https://github.com/DJDuque/pgfplots/blob/main/examples/fitted_line.rs)|[[code]](https://github.com/DJDuque/pgfplots/blob/main/examples/rectangle_integration.rs)|[[code]](https://github.com/DJDuque/pgfplots/blob/main/examples/snowflake.rs)|
|-|-|-|
|![](https://github.com/DJDuque/pgfplots/raw/main/examples/fitted_line.png)|![](https://github.com/DJDuque/pgfplots/raw/main/examples/rectangle_integration.png)|![](https://github.com/DJDuque/pgfplots/raw/main/examples/snowflake.png)|## 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](https://crates.io/crates/tectonic) crate as a dependency.