GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs.rs
  • dataplotlib-0.1.3
  • Permalink
  • Docs.rs crate page
  • MIT
  • crates.io
  • Source
  • coder543
  • piston_window ^0.52.0 normal
  • i686-unknown-linux-gnu
  • x86_64-unknown-linux-gnu
  • Feature flags
  • About docs.rs
  • Badges

This view

  • Original page
  • New address

GeezerVison is showing docs.rs — dataplotlib - Rust

Crate dataplotlib

Source
Expand description

dataplotlib is a hassle-free library for plotting data

§Example of how easy it is to use:

extern crate dataplotlib;
use dataplotlib::util::{linspace, zip2};
use dataplotlib::plotbuilder::PlotBuilder2D;
use dataplotlib::plotter::Plotter;

fn main() {
    let x = linspace(0, 10, 100);

    let y_sin = x.iter().map(|x| x.sin()).collect();
    let xy_sin = zip2(&x, &y_sin);

    let xy_lin = zip2(&x, &x);

    // Creates a new plot builder
    let mut pb = PlotBuilder2D::new();

    // Adds the sin plot and the linear plot with custom colors
    pb.add_color_xy(xy_sin, [1.0, 0.0, 0.0, 1.0]);
    pb.add_color_xy(xy_lin, [0.0, 0.0, 1.0, 1.0]);

    let mut plt = Plotter::new();
    plt.plot2d(pb);
    plt.join();
}

Modules§

  • plotbuilder
    plotbuilder provides the structs that organize the plot data, plus some helper functions
  • plotter
    plotter provides the Plotter object which handles plot creation and lifecycles
  • util
    util just provides a couple of utility functions to make life easier.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.