(ui: &Ui, plot_ui: &PlotUi)
| 5 | use implot::{push_style_var_f32, push_style_var_i32, Marker, Plot, PlotScatter, PlotUi, StyleVar}; |
| 6 | |
| 7 | pub fn show_basic_plot(ui: &Ui, plot_ui: &PlotUi) { |
| 8 | ui.text(im_str!( |
| 9 | "This header just draws a scatter plot with as little code as possible." |
| 10 | )); |
| 11 | let content_width = ui.window_content_region_width(); |
| 12 | Plot::new("Simple scatter plot") |
| 13 | // The size call could also be omitted, though the defaults don't consider window |
| 14 | // width, which is why we're not doing so here. |
| 15 | .size([content_width, 300.0]) |
| 16 | .build(plot_ui, || { |
| 17 | // If this is called outside a plot build callback, the program will panic. |
| 18 | let x_positions = vec![0.1, 0.2, 0.1, 0.5, 0.9]; |
| 19 | let y_positions = vec![0.1, 0.1, 0.3, 0.3, 0.9]; |
| 20 | PlotScatter::new("legend label").plot(&x_positions, &y_positions); |
| 21 | }); |
| 22 | } |
| 23 | |
| 24 | pub fn show_custom_markers_plot(ui: &Ui, plot_ui: &PlotUi) { |
| 25 | ui.text(im_str!( |
no test coverage detected