From 9814e86d64ca95d60e5a50d3df130ff1d1d800a8 Mon Sep 17 00:00:00 2001 From: 4bb4 <67376761+4bb4@users.noreply.github.com> Date: Sun, 13 Sep 2020 16:11:57 +0200 Subject: [PATCH] Cleaned up examples code more. --- implot-examples/examples/bar_plots.rs | 4 ++-- implot-examples/examples/scatter_plots.rs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/implot-examples/examples/bar_plots.rs b/implot-examples/examples/bar_plots.rs index 550b8ed..719cbd3 100644 --- a/implot-examples/examples/bar_plots.rs +++ b/implot-examples/examples/bar_plots.rs @@ -2,7 +2,7 @@ //! features of the libray, see the line_plots example. use imgui::{im_str, CollapsingHeader, Condition, Ui, Window}; -use implot::{push_style_var_f32, push_style_var_u32, Marker, Plot, PlotBars, StyleVar}; +use implot::{Plot, PlotBars}; mod support; @@ -45,7 +45,7 @@ fn main() { let system = support::init(file!()); let mut showing_demo = false; system.main_loop(move |_, ui| { - Window::new(im_str!("Line plots example")) + Window::new(im_str!("Bar plots example")) .size([430.0, 450.0], Condition::FirstUseEver) .build(ui, || { ui.text(im_str!("Hello from implot-rs!")); diff --git a/implot-examples/examples/scatter_plots.rs b/implot-examples/examples/scatter_plots.rs index 925e3c3..db0c9fe 100644 --- a/implot-examples/examples/scatter_plots.rs +++ b/implot-examples/examples/scatter_plots.rs @@ -25,7 +25,7 @@ fn show_basic_plot(ui: &Ui) { fn show_custom_markers_plot(ui: &Ui) { ui.text(im_str!( - "This header just plots a line with as little code as possible." + "This header shows how markers can be used in scatter plots." )); let content_width = ui.window_content_region_width(); Plot::new("Simple scatter plot") @@ -47,7 +47,8 @@ fn show_custom_markers_plot(ui: &Ui) { let marker_size = push_style_var_f32(&StyleVar::MarkerSize, 12.0); PlotScatter::new("legend label 2").plot(&x_positions, &y_positions); - // TODO(4bb4) check if these have to be in reverse push order + // TODO(4bb4) check if these have to be in reverse push order. Does not + // seem to be the case. marker_size.pop(); marker_choice.pop(); }); @@ -57,7 +58,7 @@ fn main() { let system = support::init(file!()); let mut showing_demo = false; system.main_loop(move |_, ui| { - Window::new(im_str!("Line plots example")) + Window::new(im_str!("Scatter plots example")) .size([430.0, 450.0], Condition::FirstUseEver) .build(ui, || { ui.text(im_str!("Hello from implot-rs!"));