Three-dimensional bar charts

In this recipe, we will create a three-dimensional bar chart. The three-dimensional bar chart will follow the same command as that of a scatter plot, but we will utilize the drop-line functionality to produce this 3D visualization.

Getting ready

Let's call the airquality dataset. In this particular recipe, we will use the Day, Month, and Temp variables. The Day and Month variables will represent two axes, whereas Temp will represent the third axis that gives the value of the temperature.

How to do it…

The command used here is similar to the scatter plot with the drop line added, but this time, we will hide the point and just represent each bar based on the value of the third variable. Here is the code:

scatterplot3d(Day,Month,Temp,type="h",lwd=5,pch=" ...

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.