The following imports have been used to produce the plots below:
#![allow(unused)]
fn main() {
use ndarray::Array;
use plotly::common::{
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
};
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
use plotly::Sankey;
use rand_distr::{Distribution, Normal, Uniform};
}
The to_inline_html
method is used to produce the html plot displayed in this page.
#![allow(unused)]
fn main() {
fn simple_scatter3d_plot(show: bool) -> Plot {
let n: usize = 100;
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = t.iter().map(|x| x.sin()).collect();
let z: Vec<f64> = t.iter().map(|x| x.cos()).collect();
let trace = Scatter3D::new(t, y, z).mode(Mode::Markers);
let mut plot = Plot::new();
plot.add_trace(trace);
if show {
plot.show();
}
plot
}
}