Introduce plot options to defer showing plot on the screen - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/gdt-plot.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2013年01月07日 11:00:26 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2013年01月07日 11:00:26 +0100
commit89ffc9a085ebbd3d4dbd42ec6b38510599da519d (patch)
tree835096f08c7fec436e0b803453275d2e39638481 /gdt-plot.lua
parent1148c0a18e15cf1bdf1b6db580d2536e3a69f3db (diff)
downloadgsl-shell-89ffc9a085ebbd3d4dbd42ec6b38510599da519d.tar.gz
Introduce plot options to defer showing plot on the screen
Diffstat (limited to 'gdt-plot.lua')
-rw-r--r--gdt-plot.lua 20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdt-plot.lua b/gdt-plot.lua
index 85dfef24..15888639 100644
--- a/gdt-plot.lua
+++ b/gdt-plot.lua
@@ -173,7 +173,10 @@ local function rect_funcbin(t, jxs, jys, jes)
return labels, enums, val
end
-local function gdt_table_barplot(t, jxs, jys, jes)
+local function gdt_table_barplot(t, jxs, jys, jes, opt)
+ local show_plot = true
+ if opt then show_plot = (opt.show ~= false) end
+
jxs = treat_column_refs(t, jxs)
jys = treat_column_funcrefs(t, jys)
jes = treat_column_refs(t, jes)
@@ -207,8 +210,7 @@ local function gdt_table_barplot(t, jxs, jys, jes)
end
end
- plt:show()
-
+ if show_plot then plt:show() end
return plt
end
@@ -232,7 +234,10 @@ local function add_legend(lg, k, symspec, color, text)
end
end
-local function gdt_table_lineplot(t, jxs, jys, jes)
+local function gdt_table_lineplot(t, jxs, jys, jes, opt)
+ local show_plot = true
+ if opt then show_plot = (opt.show ~= false) end
+
jxs = treat_column_refs(t, jxs)
jys = treat_column_funcrefs(t, jys)
jes = treat_column_refs(t, jes)
@@ -276,12 +281,15 @@ local function gdt_table_lineplot(t, jxs, jys, jes)
plt:set_categories('x', cat)
plt.xlab_angle = math.pi/4
- plt:show()
+ if show_plot then plt:show() end
return plt
end
local function gdt_table_xyplot(t, jx, jys, jes, opt)
+ local show_plot = true
+ if opt then show_plot = (opt.show ~= false) end
+
local path, webcolor = graph.path, graph.webcolor
local use_lines = opt and opt.lines
@@ -343,7 +351,7 @@ local function gdt_table_xyplot(t, jx, jys, jes, opt)
if mult > 1 then plt:set_legend(lg) end
- plt:show()
+ if show_plot then plt:show() end
return plt
end
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月17日 07:51:39 +0000

AltStyle によって変換されたページ (->オリジナル) /