Grid, projection and camera angles for a surface

A student draws the surface z=sin⁡xcos⁡yz = \sin x \cos y in Matplotlib. Type each missing name or value as plain text, without any module prefix such as np.


First the student turns the 1D arrays x and y into 2D coordinate grids with the NumPy function . They then add axes to the figure with the projection argument set to the string .


To look straight down on the surface, as if reading a map, they call view_init with the elevation angle elev set to degrees. To swing the camera around the vertical z-axis instead, they change the other view_init angle, named .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Creating Specialized and Three Dimensional Plots Questions: