Your equation is a three-dimensional surface that you can build by first creating a grid of x and y values, easily achieved with numpy:
X,Y = np.meshgrid( np.linspace( xmin, xmax, 100), np.linspace( ymin, ymax, 200) )
x and y are 2D arrays containing the X and Y coordinates, respectively.
Then you can calculate the z values for each point in this grid using known coefficients:
Z = c0 + c1*X + c2*Y +c3*X*X + c4*X*Y + c5*Y*Y + c6*X**3 + c7*X**2*Y + ..... c26*X*Y**5 + c27*Y**6
After that, you can build it using matplotlib :
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt ax = plt.subplot(111, projection='3d') ax.plot_surface( X, Y, Z ) plt.show()
source share