MCPcopy Create free account
hub / github.com/daniel-e/rustml / plot_normal_data

Function plot_normal_data

examples/plots.rs:12–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10use rustml::*;
11
12fn plot_normal_data() {
13
14 let seed = [1, 3, 5, 7];
15 let data = normal_builder(seed).add(1.0, 0.3).add(2.0, 0.4).take(1000).collect::<Vec<Vec<f64>>>();
16 let m = Matrix::from_row_vectors(&data).unwrap();
17
18 builder()
19 .add_columns("plot($1, $2, 'o', 'markerfacecolor', 'yellow', 'color', 'black', 'markersize', 5)", &m)
20 .add("grid on")
21 .add("axis([0, 2, 1, 3])")
22 .add("axis('nolabel')")
23 .add("print -r50 -dpng /tmp/plot_normal_1.png")
24 .run("/tmp/plot_normal_1.m")
25 .unwrap();
26
27 Window::new()
28 .show_image(&RgbImage::from_file("/tmp/plot_normal_1.png").unwrap())
29 .wait_key();
30}
31
32pub fn plot_mixture() {
33

Callers 1

mainFunction · 0.85

Calls 8

normal_builderFunction · 0.85
from_fileFunction · 0.85
runMethod · 0.80
add_columnsMethod · 0.80
wait_keyMethod · 0.80
show_imageMethod · 0.80
builderFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected