#Minimal 3D plot, showing the sin of the distance from the origin. #Python version 2.7.3 #Matplotlib version 1.1.1rc #Code also works fine with Anaconda3 / matplotlib version 1.4.0! #Code also works fine with CPython 3.4.2 + Scipy-stack-14.8.27.win32-py3.4 from # Christoph Gohlke's unofficial libraries: # http://www.lfd.uci.edu/~gohlke/pythonlibs/ #Code works fine with default Python3 + sciPy stack on Ubuntu Linux 14.04 # sudo apt-get install python3-numpy python3-scipy python3-matplotlib #Calculate data to plot. Simple SIN of distance from origin import numpy as np X = np.arange(-5, 5, 0.1) Y = np.arange(-5, 5, 0.1) NX,NY = np.meshgrid(X, Y) D = np.sqrt(NX**2 + NY**2) Z = np.sin(D) #Plot the data import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D #Required for 3D projection! fig = plt.figure() ax = fig.gca(projection='3d') #Requires Axes3D import! #rstride/cstride default to 10 on surface plots! surf = ax.plot_surface(NX,NY, Z, rstride=1, cstride=1, linewidth=0 ) plt.show()