title: Plotting a smooth surface with matplotlib
body: <p>I am new to using the matplotlib module in Python, especially plotting 3D surfaces. I have generated a data matrix, where the data corresponds to the evaluation of</p>
  <pre><code>import numpy as np
  z = np.linspace(0,3*np.pi,301)
  x = np.linspace(0,2*np.pi,201)
  </code></pre>
  <p>in the function sin(z)sin(x), that is to say</p>
  <pre><code>Y = np.sin(z).reshape((301,1))*np.sin(x).reshape((1,201))
  </code></pre>
  <p>I have managed to plot this surface using the code</p>
  <pre><code>import matplotlib.pyplot as plt
  fig = plt.figure(figsize=(10,6))
  ax1 = fig.add_subplot(111, projection='3d')
  mycmap = plt.get_cmap('gist_earth')
  ax1.set_title('gist_earth color map')
  surf1 = ax1.plot_surface(Z, X, Y.T, cmap=mycmap, rstride=2, cstride=2)
  ax1.view_init(45, 45)
  fig.colorbar(surf1, ax=ax1, shrink=0.5, aspect=5)
  </code></pre>
  <p>The result shows as follow:</p>
  <p><a href="https://i.stack.imgur.com/vxLLH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vxLLH.png" alt="enter image description here" /></a></p>
  <p>Then, I want to do the same but adding a random error term in the data matrix. To do so, the new matrix would be defined as</p>
  <pre><code>Y = np.sin(zsam).reshape((301,1))*np.sin(xsam).reshape((1,201)) + np.random.normal(0,0.25,301*201).reshape((301,201))
  </code></pre>
  <p>However, when I try to plot this matrix, I obtain this:</p>
  <p><a href="https://i.stack.imgur.com/Coe1k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Coe1k.png" alt="enter code here" /></a></p>
  <p>How can I obtain a smooth surface as in the first case? Any help would be appreciated.</p>