From 8cd8f2ec62cab763c430416aa3e9364ce72f5145 Mon Sep 17 00:00:00 2001 From: Abhishek Chaurasia Date: Thu, 15 Sep 2016 16:11:12 -0400 Subject: Added option to set/reset displaying of plot --- Logger.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Logger.lua b/Logger.lua index 48915ef..31928ec 100644 --- a/Logger.lua +++ b/Logger.lua @@ -124,8 +124,12 @@ function Logger:style(symbols) return self end -function Logger:setlogscale(value) - self.logscale = value +function Logger:setlogscale(state) + self.logscale = state +end + +function Logger:display(state) + self.showPlot = state end function Logger:plot(...) -- cgit v1.2.3 From c208ae8f70e13b2b70fc1f037a79b92e5979a352 Mon Sep 17 00:00:00 2001 From: Abhishek Chaurasia Date: Thu, 15 Sep 2016 16:12:23 -0400 Subject: Added documentation for display and logscale --- doc/logger.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/logger.md b/doc/logger.md index b7797d2..bef8ba3 100644 --- a/doc/logger.md +++ b/doc/logger.md @@ -71,3 +71,9 @@ logger:plot() ![Logging plot](logger_plot.png) If we'd like an interactive visualisation, we can put the `logger:plot()` instruction within the `for` loop, and the chart will be updated at every iteration. + +In case we'd like to prevent `gnuplot` to display the plots, we can set the option `logger:display(false)`. +In this way, plots will be saved but not displayed. +To restore the normal behaviour, use `logger:display(true)`. + +We can set a logarithmic *y* axis with `logger:setlogscale(true)` and reset it with `logger:setlogscale(false)`. -- cgit v1.2.3