Merge branch 'master' into fox-gui - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/lua-plot.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年08月03日 09:32:23 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年08月03日 09:32:23 +0200
commit7980634816359aac92c4338ea7b48ec983bb650c (patch)
treeca67e1af0d72556f4d38af3a0bf8ab9210272f69 /agg-plot/lua-plot.cpp
parent757911578dd111b05db7686c574d28f7ea63b437 (diff)
parent23e5174f22419bf6c5cf7a52c412c4ec3641a1e8 (diff)
downloadgsl-shell-7980634816359aac92c4338ea7b48ec983bb650c.tar.gz
Merge branch 'master' into fox-gui
Conflicts: agg-plot/Makefile agg-plot/lua-draw.h
Diffstat (limited to 'agg-plot/lua-plot.cpp')
-rw-r--r--agg-plot/lua-plot.cpp 34
1 files changed, 34 insertions, 0 deletions
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp
index fc2ad1f5..9f6ce209 100644
--- a/agg-plot/lua-plot.cpp
+++ b/agg-plot/lua-plot.cpp
@@ -65,6 +65,8 @@ static int plot_clear (lua_State *L);
static int plot_save_svg (lua_State *L);
static int plot_xlab_angle_set (lua_State *L);
static int plot_xlab_angle_get (lua_State *L);
+static int plot_xlab_format (lua_State *L);
+static int plot_ylab_format (lua_State *L);
static int plot_ylab_angle_set (lua_State *L);
static int plot_ylab_angle_get (lua_State *L);
static int plot_set_categories (lua_State *L);
@@ -133,6 +135,8 @@ static const struct luaL_Reg plot_properties_set[] = {
{"ytitle", plot_ytitle_set },
{"xlab_angle", plot_xlab_angle_set },
{"ylab_angle", plot_ylab_angle_set },
+ {"xlab_format", plot_xlab_format },
+ {"ylab_format", plot_ylab_format },
{"units", plot_units_set },
{"sync", plot_sync_mode_set },
{"pad", plot_pad_mode_set },
@@ -374,6 +378,36 @@ plot_axis_label_angle_get (lua_State *L, sg_plot::axis_e axis)
return 1;
}
+static int
+plot_axis_label_format (lua_State *L, sg_plot::axis_e axis)
+{
+ sg_plot *p = object_check<sg_plot>(L, 1, GS_PLOT);
+ const char* fmt = luaL_optstring(L, 2, NULL);
+
+ AGG_LOCK();
+ bool success = p->enable_label_format(axis, fmt);
+ AGG_UNLOCK();
+
+ if (success)
+ plot_update_raw (L, p, 1);
+ else
+ luaL_error(L, "got invalid label format: %s", fmt);
+
+ return 0;
+}
+
+int
+plot_xlab_format (lua_State* L)
+{
+ return plot_axis_label_format(L, sg_plot::x_axis);
+}
+
+int
+plot_ylab_format (lua_State* L)
+{
+ return plot_axis_label_format(L, sg_plot::y_axis);
+}
+
int
plot_xlab_angle_set(lua_State *L)
{
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月12日 17:02:12 +0000

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