quick_plot_2d

Function quick_plot_2d 

Source
pub fn quick_plot_2d(x: impl Into<Vec<f64>>, y: impl Into<Vec<f64>>) -> Figure
Expand description

Quickly create a 2D plot.

§Arguments

  • x - x-axis data.
  • y - y-axis data.

§Returns

Figure.

§Example

use plotting::{quick_plot_2d, Figure};

// Plot y = x^2.
let fig: Figure = quick_plot_2d([1.0, 2.0, 3.0], [1.0, 4.0, 9.0]);

§Additional examples

Additional examples can be found at https://tamaskis.github.io/plotting/plot_2d/quick_2d_plot.html.

Examples found in repository?
examples/quick_plot_2d.rs (line 6)
4fn main() {
5    // Create the figure.
6    let fig: Figure = quick_plot_2d([1.0, 2.0, 3.0], [1.0, 4.0, 9.0]);
7
8    // Save the figure so it can be displayed right below this example.
9    fig.save_inline_html(Path::new("book/src/figures/quick_plot_2d.html"));
10
11    // Alternatively, you can show the figure in a web browser.
12    // fig.show();
13}