Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ 3d plot """
- fig2 = pyplot.figure(2,figsize=(10,10))
- ax = pyplot.axes(projection='3d')
- # head
- head_theta = numpy.linspace(-numpy.pi/2,numpy.pi/2)
- head_phi = numpy.linspace(0,2*numpy.pi)
- theta,phi = numpy.meshgrid(head_theta,head_phi)
- headx = 10*numpy.cos(theta)*numpy.cos(phi)
- heady = 10*numpy.cos(theta)*numpy.sin(phi)
- headz = 10*numpy.sin(theta)
- ax = fig2.add_subplot(111, projection='3d')
- ax.plot_surface(headx,heady,headz,rstride=1,cstride=1,zorder=0)
- # hairs
- xyz_coords = shooting(4,10,0.05,0.1,latitudes,longitudes)
- for i in range(len(latitudes)):
- for j in range(len(longitudes)):
- hairx = xyz_coords[i][j][0]
- hairy = xyz_coords[i][j][1]
- hairz = xyz_coords[i][j][2]
- ax.plot3D(hairx,hairy,hairz,'black',zorder=5)
- ax.view_init(elev=10,azim=40)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("z")
- ax.set_title("3d plot")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement