From a0d1ba571c117d3b32da73f02e5cc38b1bba5164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=2E=20Brandenburg?= Date: Wed, 24 Nov 2010 13:10:04 -0500 Subject: Allow different coordinate systems to be used in Label() --- gnuplot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnuplot.py') diff --git a/gnuplot.py b/gnuplot.py index b0db2c9..fae329d 100755 --- a/gnuplot.py +++ b/gnuplot.py @@ -25,14 +25,17 @@ class CommandBuffer(object): class Label(object): - def __init__(self, x, y, txt): + def __init__(self, x, y, txt, coord=['', ''], align='center'): self.x = x self.y = y self.txt = txt - # support more label stuff optionally... + self.coord = coord + self.align = align + # support more label stuff optionally... def gnuplot_cmd(self): - return '"%s" at %f,%f center' % (self.txt, self.x, self.y) + return '"%s" at %s %f, %s %f %s' % \ + (self.txt, self.coord[0], self.x, self.coord[1], self.y, self.align) def __str__(self): return 'set label %s' % self.gnuplot_cmd() -- cgit v1.2.2