diff options
| author | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-05-23 18:16:48 -0400 |
|---|---|---|
| committer | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-05-24 23:24:31 -0400 |
| commit | ab01739fd3d30d3c808ed1773a2748d1f890f4d6 (patch) | |
| tree | 68b080efbe3b8b34708135a4adf9c4fab5694b57 | |
| parent | 41416987e07af0d5b88af580fc3428d20ab69f5e (diff) | |
Rudimentary support for (manually) placing labels
By default centered for now.
| -rwxr-xr-x | gnuplot.py | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -47,6 +47,7 @@ def gnuplot_cmd(graphs, title=None, ylabel=None, xlabel=None, | |||
| 47 | style='linespoints', xrange=None, | 47 | style='linespoints', xrange=None, |
| 48 | yrange=None, | 48 | yrange=None, |
| 49 | xticks=None, yticks=None, | 49 | xticks=None, yticks=None, |
| 50 | labels=[], | ||
| 50 | key='below', | 51 | key='below', |
| 51 | logscale=None, | 52 | logscale=None, |
| 52 | fname=None): | 53 | fname=None): |
| @@ -111,6 +112,8 @@ def gnuplot_cmd(graphs, title=None, ylabel=None, xlabel=None, | |||
| 111 | plot += ["%s title '%s' with %s" % gr] | 112 | plot += ["%s title '%s' with %s" % gr] |
| 112 | if plot: | 113 | if plot: |
| 113 | g('plot ' + ', '.join(plot)) | 114 | g('plot ' + ', '.join(plot)) |
| 115 | for (x, y, txt) in labels: | ||
| 116 | g('set label "%s" at %f,%f center' % (txt, x, y)) | ||
| 114 | if format != 'show' and fname: | 117 | if format != 'show' and fname: |
| 115 | g("set out '%s.%s'" % (fname, format)) | 118 | g("set out '%s.%s'" % (fname, format)) |
| 116 | if plot: | 119 | if plot: |
