xxxxxxxxxx
import pylab,numpy
from mpl_toolkits.mplot3d import Axes3D
t=1.1; cq=numpy.arange(0,1,.13)
cq=numpy.concatenate((cq,numpy.repeat(cq,2)))
xq=[1,-1,1,-1,1,-1,1,-1]
yq=[1,1,-1,-1,1,1,-1,-1]
zq=[1,1,1,1,-1,-1,-1,-1]
f=pylab.figure(figsize=(5,5))
ax=f.add_subplot(111,projection='3d')
q=ax.quiver(8*[0],8*[0],8*[0],xq,yq,zq,
colors=pylab.cm.hsv(cq),lw=10,alpha=.5)
ax.set_xlabel(r'$\mathscr{X}$',fontsize=15)
ax.set_ylabel(r'$\mathscr{Y}$',fontsize=15)
ax.set_zlabel(r'$\mathscr{Z}$',fontsize=15)
ax.set_xlim(-t,t); ax.set_ylim(-t,t)
ax.set_zlim(-t,t); pylab.show()
No comments:
Post a Comment