1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| from __future__ import division
from scipy import *
from pylab import *
from mpl_toolkits.mplot3d import Axes3D
import random
fig = plt.figure()
ax = fig.gca(projection='3d')
xlin = linspace(50,80,500)
ylin = linspace(85,105,20)
X, Y = meshgrid(xlin, ylin)
Z= np.zeros(shape=(20,20))
i=0
while i<20 :
j=0
while j<20 :
Z[i][j]= random.randint(5,200)
j=j+1
i=i+1
surf = ax.plot_surface(X, Y, Z(X,Y,0),color='r')
xlabel(ur"$x$", fontsize=16)
ylabel(ur"$z$", fontsize=16)
yticks( arange(2), (ur"$0$", ur"$a$"), fontsize=16)
show() |
Partager