Struct gnuplot::Figure [] [src]

pub struct Figure {
    // some fields omitted
}

A figure that may contain multiple axes

Methods

impl Figure
[src]

fn new() -> Figure

Creates a new figure

fn set_terminal<'l>(&'l mut self, terminal: &str, output_file: &str) -> &'l mut Figure

Sets the terminal for gnuplot to use, as well as the file to output the figure to. Terminals that spawn a GUI don't need an output file, so pass an empty string for those.

There are a quite a number of terminals, here are some commonly used ones:

  • wxt - Interactive GUI
  • pdfcairo - Saves the figure as a PDF file
  • epscairo - Saves the figure as a EPS file
  • pngcairo - Saves the figure as a PNG file

fn axes2d(&mut self) -> &mut Axes2D

Creates a set of 2D axes

fn axes3d(&mut self) -> &mut Axes3D

Creates a set of 3D axes

fn show(&mut self) -> &Figure

Launch a gnuplot process, if it hasn't been spawned already by a call to this function, and display the figure on it.

fn clear_axes(&mut self) -> &Figure

Clears all axes on this figure.

fn echo<'l, T: Writer>(&'l self, writer: &mut T) -> &'l Figure

Echo the commands that if piped to a gnuplot process would display the figure

Arguments

  • writer - A function pointer that will be called multiple times with the command text and data

fn echo_to_file<'l>(&'l self, filename: &str) -> &'l Figure

Save to a file the the commands that if piped to a gnuplot process would display the figure

Arguments

  • filename - Name of the file