Matplotlib is ignoring the given colourmap
<p>This is my plot:</p>

<p><a href="http://i.stack.imgur.com/7q3zW.png" rel="nofollow"><img src="http://i.stack.imgur.com/7q3zW.png" alt="enter image description here"></a></p>

<p>This is supposed to be a surface plot. As you can see that has somewhat failed. Particularly it is ignoring passed colour map.</p>

<p>It gets called as so:</p>

<pre><code>from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# Set global options
plt.rc('text', usetex=True)
plt.rc('font', family='sans-serif')

from scipy.interpolate import griddata
from matplotlib import cm
import numpy as np

class testPlot(object):

    def __init__(self,trajDict):
        # Concat dictionary into (n_i x D) for all i in speeds.
        D = np.vstack(trajDict.values())
        # Grid the data: [time,angle,velocity]
        # time
        self.X = D[:,0]
        # angle
        self.Y = D[:,1]
        # velocity
        self.Z = D[:,2]
        # All vels
        self.vels = [1.42,1.11,0.81,0.50]
    def surfacePlot(self,intMethod,wire=False,surface=False):
        zi = np.linspace(self.Z.min(),self.Z.max(),250)
        xi = np.linspace(self.X.min(),self.X.max(),250)
        yi = griddata((self.X, self.Z), 
                      self.Y,
                      (xi[None,:], zi[:,None]),
                      method=intMethod)

        fig = plt.figure(figsize=(10,10))
        ax = fig.add_subplot(111, projection='3d') #fig.gca(projection='3d')
        zig, xig = np.meshgrid(xi, zi)
        if surface:
            surf = ax.plot_surface(zig, xig, yi, 
                                   cmap='Blues',
                                   alpha=0.5)

        ax.grid(False)
        ax.set_ylabel('Velocity $[m/s]$')
        ax.set_ylim([min(self.vels)-0.2, max(self.vels)+0.2])
        ax.set_axis_off
        ax.set_zlabel('Angle $[\circ]$')
        ax.set_zlim([min(self.Y)-5,max(self.Y)+5])
        ax.set_xlabel('Gait Cycle $[\%]$')
        ax.set_xlim([self.X[0]-10,self.X[-1]])    
        plt.gca().invert_yaxis()
        plt.show()
        # Close existing windows
        plt.close(fig)
</code></pre>

<p>Passing this MWE data for test:</p>

<pre><code>OrderedDict([('a', array([[ 0.  ,  0.  ,  1.42],
                     [ 1.  ,  1.  ,  1.42],
                     [ 2.  ,  2.  ,  1.42],
                     [ 3.  ,  3.  ,  1.42],
                     [ 4.  ,  4.  ,  1.42]])),
             ('b', array([[ 0.  ,  1.  ,  1.11],
                     [ 1.  ,  2.  ,  1.11],
                     [ 2.  ,  3.  ,  1.11],
                     [ 3.  ,  4.  ,  1.11],
                     [ 4.  ,  5.  ,  1.11]])),
             ('c', array([[ 0.  ,  4.  ,  0.81],
                     [ 1.  ,  5.  ,  0.81],
                     [ 2.  ,  6.  ,  0.81],
                     [ 3.  ,  7.  ,  0.81],
                     [ 4.  ,  8.  ,  0.81]])),
             ('d', array([[  0. ,   9. ,   0.5],
                     [  1. ,  10. ,   0.5],
                     [  2. ,  11. ,   0.5],
                     [  3. ,  12. ,   0.5],
                     [  4. ,  13. ,   0.5]]))])
</code></pre>

<p>to</p>

<pre><code>myTest = testPlot(data)
myTest.surfacePlot('linear',surface=True)
</code></pre>

<p>Should give a working MWE (NOTE: it will not reproduce the plot shown above). Note that the data needs to be in the above form to work.</p>

<p>Your code is fine, and the plot shown is a surface plot. You can tell because lines in the background are behind blueish areas. Remove the alpha settings, consider using a different cmap or specify a custom range for your colorbar to fit your data range.</p>

python matplotlib