Three-dimensional scatter plots

A scatter plot is one of the simplest plots that help us view the relationship between two numeric variables. In this recipe, we will see how we can produce the scatter plot from three variables with a 3D plot. A 3D plot is good way to visualize the pattern of relation among three variables at a time. Sometimes, it could happen that a 3D plot is not depicting the relation pattern in a good shape; in this case, we might rotate the plot to find out the correct pattern. However, in this recipe, we will create a simple 3D scatter plot using three continuous variables.

Getting ready

To produce a three-dimensional scatter plot, we need to load the scatterplot3d library. If it is not already installed, then we can install ...

Get R: Data Analysis and Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.