from pyglplot import * # plot a datafile plot("sinc.data") # plot a function plot(lambda x,y: 3*sinc(norm(x,y)), xrange=(-10,10), yrange=(-10,10)) # same, but with different resolution plot(lambda x,y: 3*sinc(norm(x,y)), \ size=(97,97), xrange=(-10,10), yrange=(-10,10)) # same, with polar coordinates plot(lambda r,phi: 3*sinc(r), trans=Polar(), \ size=(49,49), xrange=(0,10), yrange=(0,2*math.pi)) # mexican hat potential plot(lambda r,phi: mexico(r), trans=Polar(), \ xrange=(0,1), yrange=(0,2*math.pi)) # funny surface plot plot(lambda x,y: math.sin(x*y), size=(97,97)) # a sphere plot(lambda phi,theta: [math.sin(phi)*math.cos(theta), \ math.sin(phi)*math.sin(theta),math.cos(phi)], \ xrange=(0,math.pi), yrange=(0,2*math.pi), size=(49,49), \ parametric=True) #if __name__ == "__main__": # main()