A
arslanburney
Hello. Was trying to create a simple plotting function. Wasnt working
however. If i write the same code without putting it inside a function
it works. :S. Could some1 tell me the problem? Heres the code:
# File name Plotting2
import Gnuplot
def plot(original, expected, actual):
if type (original) != type([]):
return False
else:
gp = Gnuplot.Gnuplot()
gp('set data style lines')
# Make the plot items
plot1 = Gnuplot.PlotItems.Data(original, title="Original")
plot2 = Gnuplot.PlotItems.Data(expected, title="Expected")
plot3 = Gnuplot.PlotItems.Data(actual, title="Acutal")
return gp.plot(plot1, plot2, plot3)
however. If i write the same code without putting it inside a function
it works. :S. Could some1 tell me the problem? Heres the code:
# File name Plotting2
import Gnuplot
def plot(original, expected, actual):
if type (original) != type([]):
return False
else:
gp = Gnuplot.Gnuplot()
gp('set data style lines')
# Make the plot items
plot1 = Gnuplot.PlotItems.Data(original, title="Original")
plot2 = Gnuplot.PlotItems.Data(expected, title="Expected")
plot3 = Gnuplot.PlotItems.Data(actual, title="Acutal")
return gp.plot(plot1, plot2, plot3)