Practice Problems

Lecture 25

Answer each number in a separate cell

Rename the notebook with your lastName and the lecture

ex. CychB_25

Turn this notebook into triton-ed by the end of class

1. Mplot3d

  • Import random from numpy and use it to generate 3 arrays- each with 10 random values.
  • Plot the points using the Axes3D .add_subplot to make a 3D figure object. Then use the method ax.scatter( ) to plot the data as blue dots.
  • Label your axes.

2. Mplot3d and subduction zones

  • Modify the 3D figure of the earthquakes around the Marianas Trench.
    • Look at the columns in the filtered DataFrame box
    • What is the magnitude of the largest earthquake? the smallest earthquake?
    • Change the color to blue and set the opacity using the alpha keyword.
    • Set the symbol size, in the 3D figure, to be proportional to the magnitude of the earthquake.
      • Hint: use the keyword argument s to set the markersize
      • Hint: you may want to normalize the magnitudes then multiply them by a scalar
In [ ]: