pub fn quick_plot_3d_with_labels(
x: impl Into<Vec<f64>>,
y: impl Into<Vec<f64>>,
z: impl Into<Vec<f64>>,
x_label: impl Into<String>,
y_label: impl Into<String>,
z_label: impl Into<String>,
title: impl Into<String>,
) -> FigureExpand description
Quickly create a 3D plot with axis labels and a title.
§Arguments
x- x-axis data.y- y-axis data.z- z-axis data.
§x_label - x-axis label.
y_label- y-axis label.z_label- z-axis label.title- Title.
§Returns
Figure.
§Example
use plotting::{quick_plot_3d_with_labels, Figure};
let fig: Figure = quick_plot_3d_with_labels(
[1.0, 2.0, 10.0],
[1.0, 4.0, 9.0],
[2.0, 5.0, 10.0],
"x",
"y",
"z",
"z vs. x and y",
);§Additional examples
Additional examples can be found at https://tamaskis.github.io/plotting/plot_3d/quick_3d_plot_with_labels.html.
Examples found in repository?
examples/quick_plot_3d_with_labels.rs (lines 6-14)
4fn main() {
5 // Create the figure.
6 let fig: Figure = quick_plot_3d_with_labels(
7 [1.0, 2.0, 10.0],
8 [1.0, 4.0, 9.0],
9 [2.0, 5.0, 10.0],
10 "x",
11 "y",
12 "z",
13 "z vs. x and y",
14 );
15
16 // Save the figure so it can be displayed right below this example.
17 fig.save_inline_html(Path::new("book/src/figures/quick_plot_3d_with_labels.html"));
18
19 // Alternatively, you can show the figure in a web browser.
20 // fig.show();
21}