From ab01739fd3d30d3c808ed1773a2748d1f890f4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20B=2E=20Brandenburg?= Date: Sun, 23 May 2010 18:16:48 -0400 Subject: Rudimentary support for (manually) placing labels By default centered for now. --- gnuplot.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gnuplot.py') diff --git a/gnuplot.py b/gnuplot.py index c4e2afd..260fbf5 100755 --- a/gnuplot.py +++ b/gnuplot.py @@ -47,6 +47,7 @@ def gnuplot_cmd(graphs, title=None, ylabel=None, xlabel=None, style='linespoints', xrange=None, yrange=None, xticks=None, yticks=None, + labels=[], key='below', logscale=None, fname=None): @@ -111,6 +112,8 @@ def gnuplot_cmd(graphs, title=None, ylabel=None, xlabel=None, plot += ["%s title '%s' with %s" % gr] if plot: g('plot ' + ', '.join(plot)) + for (x, y, txt) in labels: + g('set label "%s" at %f,%f center' % (txt, x, y)) if format != 'show' and fname: g("set out '%s.%s'" % (fname, format)) if plot: -- cgit v1.2.2