I have a little problem. I have a program that will draw a wave function for potential, and it looks great when I use the option in the plot (using pylab) '-', for example: http://img41.imageshack.us/img41/8798/59138635. png
If I use 'o', I will get:
http://img16.imageshack.us/img16/3741/22378006.png
You see that it looks ugly: \
Is there an easy way to make circles more spaced or does it depend on the details of the code?
The code:
from math import *
from scipy.special import *
from pylab import *
from scipy.linalg import *
firebrick=(178./255.,34./255.,34./255.)
indianred=(176./255.,23./255.,31./255.)
steelblue=(70./255.,130./255.,180./255.)
slategray1=(198./255.,226./255.,255./255.)
slategray4=(108./255.,123./255.,139./255.)
lavender=(230./255.,230./255.,230./255.)
cobalt=(61./255.,89./255.,171./255.)
midnightblue=(25./255.,25./255.,112./255.)
forestgreen=(34./255.,139./255.,34./255.)
Nmesh=512
L=4.0
dx=L/Nmesh
Xmax=L
x=arange(-L,L+0.0001,dx)
Npts=len(x)
numwav=2
V=zeros([Npts],float)
for i in range(Npts):
V[i]=x[i]**4
a=zeros([2,Npts-2],float)
wave=zeros([Npts],float)
wave1=zeros([Npts],float)
encor=3.0/4*(3.0/4)**(1.0/3)
for i in range(1,Npts-1,1):
a[0,i-1]= 1.0/dx**2+V[i]
a[1,i-1]=-1.0/dx**2/2
a[1,Npts-3]=-99.0
eig,vec=eig_banded(a,lower=1)
for i in range(1,Npts-1,1):
wave[i]=vec[i-1,numwav]
wave[0]=0.0
wave[Npts-1]=0.0
wave=150*wave+eig[numwav]
line=plt.plot(x,V)
plt.setp(line,color='firebrick',linewidth=2)
plt.axhline(y=eig[numwav],linewidth=2,color='steelblue')
plt.plot(x,wave,"b-",linewidth=2,color='forestgreen')
plt.xlabel('x',size=16)
plt.ylabel('V(x)',size=16)
plt.axis([-4.0,4.0,-5.0,16.0])
plt.grid(True)
plt.show()