aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn B. Brandenburg <bbb@cs.unc.edu>2010-06-10 21:15:41 -0400
committerBjörn B. Brandenburg <bbb@cs.unc.edu>2010-06-10 21:15:41 -0400
commita43beaa10a61d2875b40596ee03d6ef9024fb22c (patch)
treeec6d67d79295015526880accbafc8f91ef10fee5
parent201465a8ae7eebb5acb7a5b20c919099875f108c (diff)
Support smoothing of individual graphs.
-rwxr-xr-xgnuplot.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnuplot.py b/gnuplot.py
index 3a7b364..b0db2c9 100755
--- a/gnuplot.py
+++ b/gnuplot.py
@@ -40,14 +40,14 @@ class Label(object):
40 40
41class FileGraph(object): 41class FileGraph(object):
42 def __init__(self, fname, xcol=1, ycol=2, error=None, 42 def __init__(self, fname, xcol=1, ycol=2, error=None,
43 title=None, 43 title=None, style=None, smooth=None):
44 style=None):
45 self.fname = fname 44 self.fname = fname
46 self.xcol = xcol 45 self.xcol = xcol
47 self.ycol = ycol 46 self.ycol = ycol
48 self.error = error 47 self.error = error
49 self.title = title 48 self.title = title
50 self.style = style # replace with linetype, lines/points etc. 49 self.style = style # replace with linetype, lines/points etc.
50 self.smooth = smooth
51 51
52 def __str__(self): 52 def __str__(self):
53 return self.gnuplot_cmd() 53 return self.gnuplot_cmd()
@@ -61,8 +61,9 @@ class FileGraph(object):
61 style = self.style if self.style else default_style 61 style = self.style if self.style else default_style
62 style_txt = " with %s" % style if style else "" 62 style_txt = " with %s" % style if style else ""
63 title_txt = ' title "%s"' % self.title if self.title else "" 63 title_txt = ' title "%s"' % self.title if self.title else ""
64 return "'%s' using %s%s%s" % \ 64 smooth_txt = ' smooth %s' % self.smooth if self.smooth else ""
65 (self.fname, using_txt, title_txt, style_txt) 65 return "'%s' using %s%s%s%s" % \
66 (self.fname, using_txt, title_txt, style_txt, smooth_txt)
66 67
67 68
68class LiteralGraph(object): 69class LiteralGraph(object):