import Gnuplot
gp2 = Gnuplot.Gnuplot(persist=1) #persist=1 keeps the window open after the program runs
gp2('set data style lines')
gp2('set termoption enhanced') #so that the fancy symbols below work in the GUI display
gp2('set title "Graph of {/Symbol Y}_{II}"')
gp2('set xlabel "x (meters)"')
gp2('set ylabel "{/Symbol Y}"')
gp3 = Gnuplot.Gnuplot(persist=1) #create a different object for a different plot
gp3('set data style lines')
gp3('set termoption enhanced')
gp3('set title "Graph of {/Symbol Y}_{III}"')
gp3('set xlabel "x (meters)"')
gp3('set ylabel "{/Symbol Y}"')
#Generate wave function data for the specified energy levels
num_divisions=1000
spacing=L/num_divisions
x2=arange(0,L, spacing)
x3=arange(L,2*L, spacing)
Psi2_0=A[0]*Psi2(x2,L_2[0])
Psi2_1=A[1]*Psi2(x2,L_2[1])
Psi2_2=A[2]*Psi2(x2,L_2[2])
Psi3_0=Psi3(x3,L_3[0])
Psi3_1=Psi3(x3,L_3[1])
Psi3_2=Psi3(x3,L_3[2])
plot2_0=Gnuplot.PlotItems.Data(x2,Psi2_0,title='{/Symbol Y}_{II_0}')
plot2_1=Gnuplot.PlotItems.Data(x2,Psi2_1,title='{/Symbol Y}_{II_1}')
plot2_2=Gnuplot.PlotItems.Data(x2,Psi2_2,title='{/Symbol Y}_{II_2}')
plot3_0=Gnuplot.PlotItems.Data(x3,Psi3_0,title='{/Symbol Y}_{III_0}')
plot3_1=Gnuplot.PlotItems.Data(x3,Psi3_1,title='{/Symbol Y}_{III_1}')
plot3_2=Gnuplot.PlotItems.Data(x3,Psi3_2,title='{/Symbol Y}_{III_2}')
gp2.plot(plot2_0,plot2_1,plot2_2)
gp3.plot(plot3_0,plot3_1,plot3_2)
#note that terminal="postscript enhanced" returns an error, you have set "enhanced" as so
gp2.hardcopy(filename="psi2.ps",terminal="postscript",enhanced=1)
gp3.hardcopy(filename="psi3.ps",terminal="postscript",enhanced=1)