diff options
Diffstat (limited to 'gnuplot.py')
-rwxr-xr-x | gnuplot.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -25,14 +25,17 @@ class CommandBuffer(object): | |||
25 | 25 | ||
26 | 26 | ||
27 | class Label(object): | 27 | class Label(object): |
28 | def __init__(self, x, y, txt): | 28 | def __init__(self, x, y, txt, coord=['', ''], align='center'): |
29 | self.x = x | 29 | self.x = x |
30 | self.y = y | 30 | self.y = y |
31 | self.txt = txt | 31 | self.txt = txt |
32 | # support more label stuff optionally... | 32 | self.coord = coord |
33 | self.align = align | ||
34 | # support more label stuff optionally... | ||
33 | 35 | ||
34 | def gnuplot_cmd(self): | 36 | def gnuplot_cmd(self): |
35 | return '"%s" at %f,%f center' % (self.txt, self.x, self.y) | 37 | return '"%s" at %s %f, %s %f %s' % \ |
38 | (self.txt, self.coord[0], self.x, self.coord[1], self.y, self.align) | ||
36 | 39 | ||
37 | def __str__(self): | 40 | def __str__(self): |
38 | return 'set label %s' % self.gnuplot_cmd() | 41 | return 'set label %s' % self.gnuplot_cmd() |