diff --git a/gnuplot-py/PlotItems.py b/gnuplot-py/PlotItems.py index aa94e16..7dfd12e 100755 --- a/gnuplot-py/PlotItems.py +++ b/gnuplot-py/PlotItems.py @@ -85,8 +85,8 @@ class PlotItem: _option_list = { 'axes' : lambda self, axes: self.set_string_option( 'axes', axes, None, 'axes %s'), - 'with' : lambda self, with: self.set_string_option( - 'with', with, None, 'with %s'), + 'with_' : lambda self, with_: self.set_string_option( + 'with_', with_, None, 'with_ %s'), 'title' : lambda self, title: self.set_string_option( 'title', title, 'notitle', 'title "%s"'), } @@ -95,7 +95,7 @@ class PlotItem: _option_sequence = [ 'binary', 'index', 'every', 'thru', 'using', 'smooth', - 'axes', 'title', 'with' + 'axes', 'title', 'with_' ] def __init__(self, **keyw): @@ -103,8 +103,8 @@ class PlotItem: Keyword options: - 'with=' -- choose how item will be plotted, e.g., - with='points 3 3'. + 'with_=' -- choose how item will be plotted, e.g., + with_='points 3 3'. 'title=' -- set the title to be associated with the item in the plot legend. @@ -217,7 +217,7 @@ class Func(PlotItem): into gnuplot itself. The argument to the contructor is a string that should be a mathematical expression. Example:: - g.plot(Func('sin(x)', with='line 3')) + g.plot(Func('sin(x)', with_='line 3')) As shorthand, a string passed to the plot method of a Gnuplot object is also treated as a Func:: diff --git a/gnuplot-py/demo.py b/gnuplot-py/demo.py index 706ad63..89bb3c7 100755 --- a/gnuplot-py/demo.py +++ b/gnuplot-py/demo.py @@ -47,7 +47,7 @@ def demo(): # written to a temporary file once. d = Gnuplot.Data(x, y1, title='calculated by python', - with='points 3 3') + with_='points 3 3') g.title('Data can be computed by python or gnuplot') g.xlabel('x') g.ylabel('x squared') diff --git a/gnuplot-py/test.py b/gnuplot-py/test.py index 0da15ed..99a46d4 100755 --- a/gnuplot-py/test.py +++ b/gnuplot-py/test.py @@ -70,7 +70,7 @@ def main(): g.replot() wait('Style linespoints') - g.plot(Gnuplot.Func('sin(x)', with='linespoints')) + g.plot(Gnuplot.Func('sin(x)', with_='linespoints')) wait('title=None') g.plot(Gnuplot.Func('sin(x)', title=None)) wait('title="Sine of x"') @@ -83,7 +83,7 @@ def main(): wait('Original') g.plot(f) wait('Style linespoints') - f.set_option(with='linespoints') + f.set_option(with_='linespoints') g.plot(f) wait('title=None') f.set_option(title=None) @@ -100,20 +100,20 @@ def main(): g.plot(Gnuplot.File(filename1)) wait('Style lines') - g.plot(Gnuplot.File(filename1, with='lines')) + g.plot(Gnuplot.File(filename1, with_='lines')) wait('using=1, using=(1,)') - g.plot(Gnuplot.File(filename1, using=1, with='lines'), - Gnuplot.File(filename1, using=(1,), with='points')) + g.plot(Gnuplot.File(filename1, using=1, with_='lines'), + Gnuplot.File(filename1, using=(1,), with_='points')) wait('using=(1,2), using="1:3"') g.plot(Gnuplot.File(filename1, using=(1,2)), Gnuplot.File(filename1, using='1:3')) wait('every=5, every=(5,)') - g.plot(Gnuplot.File(filename1, every=5, with='lines'), - Gnuplot.File(filename1, every=(5,), with='points')) + g.plot(Gnuplot.File(filename1, every=5, with_='lines'), + Gnuplot.File(filename1, every=(5,), with_='points')) wait('every=(10,None,0), every="10::5"') - g.plot(Gnuplot.File(filename1, with='lines'), + g.plot(Gnuplot.File(filename1, with_='lines'), Gnuplot.File(filename1, every=(10,None,0)), Gnuplot.File(filename1, every='10::5')) @@ -127,7 +127,7 @@ def main(): wait('Original') g.plot(f) wait('Style linespoints') - f.set_option(with='linespoints') + f.set_option(with_='linespoints') g.plot(f) wait('using=(1,3)') f.set_option(using=(1,3)) @@ -154,8 +154,8 @@ def main(): g.plot(Gnuplot.Data(d, inline=0)) wait('Same thing, inline data') g.plot(Gnuplot.Data(d, inline=1)) - wait('with="lp 4 4"') - g.plot(Gnuplot.Data(d, with='lp 4 4')) + wait('with_="lp 4 4"') + g.plot(Gnuplot.Data(d, with_='lp 4 4')) wait('cols=0') g.plot(Gnuplot.Data(d, cols=0)) wait('cols=(0,1), cols=(0,2)') @@ -179,13 +179,13 @@ def main(): g.plot(Gnuplot.funcutils.compute_Data(x, lambda x: math.cos(x), inline=0)) wait('Same thing, inline data') g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, inline=1)) - wait('with="lp 4 4"') - g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, with='lp 4 4')) + wait('with_="lp 4 4"') + g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, with_='lp 4 4')) print '############### test hardcopy ###############################' print '******** Generating postscript file "gp_test.ps" ********' wait() - g.plot(Gnuplot.Func('cos(0.5*x*x)', with='linespoints 2 2', + g.plot(Gnuplot.Func('cos(0.5*x*x)', with_='linespoints 2 2', title='cos(0.5*x^2)')) g.hardcopy('gp_test.ps') @@ -229,9 +229,9 @@ def main(): print '############### test splot ##################################' wait('a 3-d curve') - g.splot(Gnuplot.Data(d, with='linesp', inline=0)) + g.splot(Gnuplot.Data(d, with_='linesp', inline=0)) wait('Same thing, inline data') - g.splot(Gnuplot.Data(d, with='linesp', inline=1)) + g.splot(Gnuplot.Data(d, with_='linesp', inline=1)) print '############### test GridData and compute_GridData ##########' # set up x and y values at which the function will be tabulated: