()
| 4 | use rustml::opencv::*; |
| 5 | |
| 6 | fn main() { |
| 7 | let o = builder() |
| 8 | .add("x = linspace(-10, 10, 80)") |
| 9 | .add("y = x.^2 + sin(x) .* (x .* x)") |
| 10 | .add("plot(x, y, 'linewidth', 2)") |
| 11 | .add("grid on") |
| 12 | .add("print -dpng '/tmp/example_plot.png'"); |
| 13 | |
| 14 | o.run("/tmp/example_plot.m").unwrap(); |
| 15 | Window::new() |
| 16 | .show_image(&RgbImage::from_file("/tmp/example_plot.png").unwrap()) |
| 17 | .wait_key(); |
| 18 | } |
| 19 |