Source code has been (very) slightly modified into fully object-oriented matplotlib interface. The original shebang was also removed.
The matplotlib (mpl) version is 1.5.3, with Python 2.7 and numpy 1.10
############ Code for the figure##########"""This generates the graph of the function f(x, y) = sin(sqrt(x^2 + y^2))."""importmatplotlib.pyplotaspltimportnumpyasnpfrommatplotlibimportcmfrommpl_toolkits.mplot3dimportAxes3Dfig=plt.figure()fig.clf()ax=fig.add_subplot(1,1,1,projection='3d')x=np.arange(-5,5,0.25)y=np.arange(-5,5,0.25)X,Y=np.meshgrid(x,y)R=np.sqrt(X*X+Y*Y)Z=np.sin(R)surf=ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=cm.coolwarm)fig.savefig("matplotlib_3d.svg")plt.show()##########
Conditions d’utilisation
Moi, en tant que détenteur des droits d’auteur sur cette œuvre, je la publie sous la licence suivante :
de partager – de copier, distribuer et transmettre cette œuvre
d’adapter – de modifier cette œuvre
Sous les conditions suivantes :
paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
partage à l’identique – Si vous modifiez, transformez, ou vous basez sur cette œuvre, vous devez distribuer votre contribution sous la même licence ou une licence compatible avec celle de l’original.