Why does my code to plot a cone actually generate a roof?
You need to change the call to sqrt from:

np.sqrt(xx**2, yy**2)


to:

np.sqrt(xx**2 + yy**2)


Otherwise you're passing an array of values to the function and will be returned an array of values for the answer.

See here for details:


  &gt;&gt;&gt; np.sqrt([1,4,9])
  
  array([ 1.,  2.,  3.])