1. Learn
  2. /
  3. Courses
  4. /
  5. Plotly Tutorial: Plotly and R

Exercise

Visualizing volcano data

Mount Eden is a volcano in the Auckland volcanic field. The volcano dataset gives topographic information for Mount Eden on a 10m by 10m grid. Run str(volcano) to examine the dataset.

<img src="http://lh6.ggpht.com/-ONlugp32B3o/VHwNdsi3EcI/AAAAAAAA9dI/b9DWnqncHFA/mount-wellington%25255B5%25255D.jpg?imgmax=800" ;="" height="200px" [removed]

One way to look at the topographic data is via a heatmap. The heatmap's color pattern visualizes how the height of the volcano's surface fluctuates within this 10m by 10m grid.

Alternatively, you could visualize the data by making a 3D surface plot. Namely, plotly visualizations don't actually require a data frame. This makes chart types that accept a z argument especially easy to use if you have a numeric matrix such as our volcano dataset.

Let's try to create that heatmap and 3D surface plot.

Instructions

100 XP

Create two interactive plots using the volcano dataset:

  • For one the type of trace is a heatmap.
  • For the other surface since you also want to see a 3D representation.