()
| 10 | use rustml::*; |
| 11 | |
| 12 | fn 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 | |
| 32 | pub fn plot_mixture() { |
| 33 |
no test coverage detected