title: Continuous colourmap in Matplotlib
body: <p>I am trying to plot a 3D graph with <code>matplotlib</code> using the <code>plot_surface</code> command, but the colour scheme looks discrete on the plot. Is there a way to have a continuous colour gradient between the points?</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  fig = plt.figure(2, figsize=(8,6))
  plt.rcParams.update({"font.size":16})
  
  ax = fig.gca(projection='3d')
  ax.set_xlabel('$t$', labelpad=10)
  ax.set_ylabel('$x$', labelpad=10)
  ax.set_zlabel('$Y(x,t)$', labelpad=10)
  
  ax.xaxis.set_major_locator(plt.MaxNLocator(5))
  ax.yaxis.set_major_locator(plt.MaxNLocator(6))
  ax.zaxis.set_major_locator(plt.MaxNLocator(6))
  
  ax.xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
  ax.yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
  ax.zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
  
  ax.plot_surface(t, x, Yplot, rstride=1, cstride=1, cmap=cm.viridis)
  
  plt.tight_layout()
  plt.show()
  </code></pre>
  
  <p>Here is an example of what I mean by "discrete colour scheme":</p>
  
  <p><img src="https://i.stack.imgur.com/I6Yg2.png" alt="Plot"></p>