June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, we will learn how to make contour plots to visualize topographical data, such as the terrain near a mountain or a volcano.
We are only using the base graphics functions for this recipe. So, just open up the R prompt and type the following code. We will use the inbuilt volcano dataset, so we need not load anything.
Let's first make a default contour plot with volcano:
contour(x=10*1:nrow(volcano), y=10*1:ncol(volcano), z=volcano, xlab="Metres West",ylab="Metres North", main="Topography of Maunga Whau Volcano")

We used the contour() base graphics library function to make ...
Read now
Unlock full access