Some screenshoot below was taken from my Mac. You may wonder ‘Hey, we render in python using Matplotlib, did’nt we?’. Yeah, pylab is part of matplotlib, so, have fun…
from pylab import grid, xlabel, ylabel, title, plot, ylim, xlim, show, sin, cos
r=10
x=[]
y=[]
n=19
for i in range(n):
y.append([])
x.append([])
y[i].append(0)
x[i].append(0)
for i in range(n):
phi=7*i
y[i].append(r*sin(phi))
x[i].append(r*cos(phi))
grid(True)
xlabel('Sumbu x')
ylabel('Sumbu y')
title('Jejak ')
plot(x[0],y[0],'b-',x[1],y[1],'g-',
x[2],y[2],'r-',x[3],y[3],'b-',x[4],y[4],'r-')
batas=10
ylim(-batas,batas)
xlim(-batas,batas)
show()
From Ubuntu Karmic Koala |
from pylab import grid, xlabel, ylabel, title, plot, ylim, xlim, show, sin
|
From Ubuntu Karmic Koala |
From Ubuntu Karmic Koala |