
import numpy
import matplotlib.pyplot as pyplot

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm

mass = numpy.array([[ 18.22465533,  18.00251701,  17.62452766,  17.08328337,
         16.64446691,  16.20617784,  16.20213199,  16.24730025,
         16.12760523,  16.24730025,  16.20213199,  16.20617784,
         16.64446691,  17.08328337,  17.62452766,  18.00251701,
         18.22465533],
       [ 18.00251701,  17.71729949,  17.09807672,  16.27579098,
         15.54573964,  14.53991623,  15.25545657,  15.25413027,
         14.47447204,  15.25413027,  15.25545657,  14.53991623,
         15.54573964,  16.27579098,  17.09807672,  17.71729949,
         18.00251701],
       [ 17.62452766,  17.09807672,  15.90373742,  14.27679056,
         13.58062705,          0.0,  13.80087252,  13.80245308,
                 0.0,  13.80245308,  13.80087252,          0.0,
         13.58062705,  14.27679056,  15.90373742,  17.09807672,
         17.62452766],
       [ 17.08328337,  16.27579098,  14.27679056,          0.0,
         12.97728114,  13.10424848,  14.19014428,  14.29143371,
         13.50522421,  14.29143371,  14.19014428,  13.10424848,
         12.97728114,          0.0,  14.27679056,  16.27579098,
         17.08328337],
       [ 16.64446691,  15.54573964,  13.58062705,  12.97728114,
         13.44205366,  13.05495175,  14.00502632,  14.09503232,
         13.30668529,  14.09503232,  14.00502632,  13.05495175,
         13.44205366,  12.97728114,  13.58062705,  15.54573964,
         16.64446691],
       [ 16.20617784,  14.53991623,          0.0,  13.10424848,
         13.05495175,          0.0,  13.16855387,  13.22279742,
                 0.0,  13.22279742,  13.16855387,          0.0,
         13.05495175,  13.10424848,          0.0,  14.53991623,
         16.20617784],
       [ 16.20213199,  15.25545657,  13.80087252,  14.19014428,
         14.00502632,  13.16855387,  13.97513498,  13.9832428 ,
         13.18943598,  13.9832428 ,  13.97513498,  13.16855387,
         14.00502632,  14.19014428,  13.80087252,  15.25545657,
         16.20213199],
       [ 16.24730025,  15.25413027,  13.80245308,  14.29143371,
         14.09503232,  13.22279742,  13.9832428 ,  13.93987066,
         13.19122828,  13.93987066,  13.9832428 ,  13.22279742,
         14.09503232,  14.29143371,  13.80245308,  15.25413027,
         16.24730025],
       [ 16.12760523,  14.47447204,          0.0,  13.50522421,
         13.30668529,          0.0,  13.18943598,  13.19122828,
                 0.0,  13.19122828,  13.18943598,          0.0,
         13.30668529,  13.50522421,          0.0,  14.47447204,
         16.12760523],
       [ 16.24730025,  15.25413027,  13.80245308,  14.29143371,
         14.09503232,  13.22279742,  13.9832428 ,  13.93987066,
         13.19122828,  13.93987066,  13.9832428 ,  13.22279742,
         14.09503232,  14.29143371,  13.80245308,  15.25413027,
         16.24730025],
       [ 16.20213199,  15.25545657,  13.80087252,  14.19014428,
         14.00502632,  13.16855387,  13.97513498,  13.9832428 ,
         13.18943598,  13.9832428 ,  13.97513498,  13.16855387,
         14.00502632,  14.19014428,  13.80087252,  15.25545657,
         16.20213199],
       [ 16.20617784,  14.53991623,          0.0,  13.10424848,
         13.05495175,          0.0,  13.16855387,  13.22279742,
                 0.0,  13.22279742,  13.16855387,          0.0,
         13.05495175,  13.10424848,          0.0,  14.53991623,
         16.20617784],
       [ 16.64446691,  15.54573964,  13.58062705,  12.97728114,
         13.44205366,  13.05495175,  14.00502632,  14.09503232,
         13.30668529,  14.09503232,  14.00502632,  13.05495175,
         13.44205366,  12.97728114,  13.58062705,  15.54573964,
         16.64446691],
       [ 17.08328337,  16.27579098,  14.27679056,          0.0,
         12.97728114,  13.10424848,  14.19014428,  14.29143371,
         13.50522421,  14.29143371,  14.19014428,  13.10424848,
         12.97728114,          0.0,  14.27679056,  16.27579098,
         17.08328337],
       [ 17.62452766,  17.09807672,  15.90373742,  14.27679056,
         13.58062705,          0.0,  13.80087252,  13.80245308,
                 0.0,  13.80245308,  13.80087252,          0.0,
         13.58062705,  14.27679056,  15.90373742,  17.09807672,
         17.62452766],
       [ 18.00251701,  17.71729949,  17.09807672,  16.27579098,
         15.54573964,  14.53991623,  15.25545657,  15.25413027,
         14.47447204,  15.25413027,  15.25545657,  14.53991623,
         15.54573964,  16.27579098,  17.09807672,  17.71729949,
         18.00251701],
       [ 18.22465533,  18.00251701,  17.62452766,  17.08328337,
         16.64446691,  16.20617784,  16.20213199,  16.24730025,
         16.12760523,  16.24730025,  16.20213199,  16.20617784,
         16.64446691,  17.08328337,  17.62452766,  18.00251701,
         18.22465533]])


# Convert zeros to None to avoid scaling issues.
if True:
    for i in xrange(len(mass)):
        for j in xrange(len(mass[i])):
            if not mass[i,j]: mass[i,j] = None

fig = pyplot.figure()
ax = Axes3D(fig)

x = numpy.arange(mass.shape[0])
y = numpy.arange(mass.shape[1])

X, Y = numpy.meshgrid(x, y)
ax.plot_surface(X, Y, mass, rstride=1, cstride=1, cmap=cm.jet)

ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
ax.set_zlabel('Z-axis')

pyplot.show()

