title: Plotting x^2 + y^2 = z^2 = 1 using matplotlib without parametric form
body: <p>I want to plot the unit sphere x^2 + y^2 + z^2 = 1  &amp; I am trying to use sympy , numpy , and matplotlib for the same.
  Below is a code snippet:</p>
  
  <pre><code>x,y = sp.symbols('x y')
  
  def g(x,y):
      return sqrt(1-x**2 - y**2)
  xrange2 = np.linspace(-1, 1, 100)
  yrange2 = np.linspace(-1, 1, 100)
  X2, Y2 = np.meshgrid(xrange2, yrange2)
  Z2 = g(X2, Y2)
  Z2[(1- X2**2 - Y2**2 &lt; 0)] = np.nan
  Z2[(1- X2**2 - Y2**2 &gt; 0)] = np.nan
  ax.plot_surface(X2, Y2, Z2,cmap='Blues', antialiased=True, edgecolor='black')
  
  </code></pre>
  
  <p>I don't wish to use parametric equations for the sphere, but rather plot it using x , y and z.
  Currently getting below error:
  Z contains NaN values. This may result in rendering artifacts.</p>