All Projects → ubnt-intrepid → Rustplotlib

ubnt-intrepid / Rustplotlib

Licence: mit
A Rust's binding of matplotlib

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rustplotlib

publib
Produce publication-level quality images on top of Matplotlib
Stars: ✭ 34 (+9.68%)
Mutual labels:  plot, matplotlib
heatmaps
Better heatmaps in Python
Stars: ✭ 117 (+277.42%)
Mutual labels:  plot, matplotlib
Matplotlib4j
Matplotlib for java: A simple graph plot library for java with powerful python matplotlib
Stars: ✭ 107 (+245.16%)
Mutual labels:  matplotlib, plot
Itermplot
An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.
Stars: ✭ 1,267 (+3987.1%)
Mutual labels:  matplotlib, plot
bitrate-plotter
Plots a graph showing the bitrate every second or the bitrate of every GOP, for a video or audio file.
Stars: ✭ 15 (-51.61%)
Mutual labels:  plot, matplotlib
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (+2258.06%)
Mutual labels:  matplotlib, plot
sarviewer
Generate graphs with gnuplot or matplotlib (Python) from sar data
Stars: ✭ 60 (+93.55%)
Mutual labels:  plot, matplotlib
mltb
Machine Learning Tool Box
Stars: ✭ 25 (-19.35%)
Mutual labels:  plot, matplotlib
matplotlib-haskell
Haskell bindings for Python's Matplotlib
Stars: ✭ 80 (+158.06%)
Mutual labels:  plot, matplotlib
reddit-hot-recorder
Records the activity (comments and karma) on the hot page of a Reddit sub and prepare an animated data visualisation.
Stars: ✭ 89 (+187.1%)
Mutual labels:  plot, matplotlib
Tensorflow Plot
📈 TensorFlow + Matplotlib as TF ops
Stars: ✭ 285 (+819.35%)
Mutual labels:  matplotlib, plot
nodeplotlib
NodeJS plotting library for JavaScript and TypeScript. On top of plotly.js. Inspired by matplotlib.
Stars: ✭ 115 (+270.97%)
Mutual labels:  plot, matplotlib
Vapeplot
matplotlib extension for vaporwave aesthetics
Stars: ✭ 483 (+1458.06%)
Mutual labels:  matplotlib, plot
Ofxgrafica
A simple and configurable plotting library for openFrameworks
Stars: ✭ 24 (-22.58%)
Mutual labels:  plot
Uplot
📈 A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+21861.29%)
Mutual labels:  plot
Notes Python
中文 Python 笔记
Stars: ✭ 6,127 (+19664.52%)
Mutual labels:  matplotlib
Crime Analysis
Association Rule Mining from Spatial Data for Crime Analysis
Stars: ✭ 20 (-35.48%)
Mutual labels:  matplotlib
Ofxgraph
ofxGraph is a simple, easy and quick graph add-on for openframeworks.
Stars: ✭ 23 (-25.81%)
Mutual labels:  plot
Function Plot
A 2d function plotter powered by d3 and interval arithmetic
Stars: ✭ 625 (+1916.13%)
Mutual labels:  plot
Youtube Report
📊 Generate a personal YouTube report from your Google Takeout data
Stars: ✭ 607 (+1858.06%)
Mutual labels:  matplotlib

rustplotlib docs.rs Build Status

A tiny library for creating 2D charts, by using matplotlib.

This project is inspired by mneumann's matplotlib-rs, and SiegeLord's RustGnuplot.

WARNING

This project is currently under the development. It means that some broken changes will be occurred in API.

The development version of API documentation is here.

Features

  • builder style API
  • support for multiple backends

Example

extern crate rustplotlib;

use rustplotlib::Figure;

fn make_figure<'a>(x: &'a [f64], y1: &'a [f64], y2: &'a [f64]) -> Figure<'a> {
  use rustplotlib::{Axes2D, Scatter, Line2D, FillBetween};

  let ax1 = Axes2D::new()
    .add(Scatter::new(r"$y_1 = \sin(x)$")
      .data(x, y1)
      .marker("o"))
    .add(Line2D::new(r"$y_2 = \cos(x)$")
      .data(x, y2)
      .color("red")
      .marker("x")
      .linestyle("--")
      .linewidth(1.0))
    .xlabel("Time [sec]")
    .ylabel("Distance [mm]")
    .legend("lower right")
    .xlim(0.0, 8.0)
    .ylim(-2.0, 2.0);

  let ax2 = Axes2D::new()
    .add(FillBetween::new()
      .data(x, y1, y2)
      .interpolate(true))
    .xlim(0.0, 8.0)
    .ylim(-1.5, 1.5);

  Figure::new()
    .subplots(2, 1, vec![Some(ax1), Some(ax2)])
}

fn main() {
  use std::f64::consts::PI;
  let x: Vec<f64> = (0..40).into_iter().map(|i| (i as f64) * 0.08 * PI).collect();
  let y1: Vec<f64> = x.iter().map(|x| x.sin()).collect();
  let y2: Vec<f64> = x.iter().map(|x| x.cos()).collect();

  let fig = make_figure(&x, &y1, &y2);

  use rustplotlib::Backend;
  use rustplotlib::backend::Matplotlib;
  let mut mpl = Matplotlib::new().unwrap();
  mpl.set_style("ggplot").unwrap();
  
  fig.apply(&mut mpl).unwrap();
  
  mpl.savefig("simple.png").unwrap();
  mpl.dump_pickle("simple.fig.pickle").unwrap();
  mpl.wait().unwrap();
}

example

See examples/simple.rs for details.

License

This software is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].