R
allows to build three dimensional charts, mainly thanks
to the rgl
package. Even if 3D is often a
bad practice,
it can be useful in specific situation. This section provides several
examples made in R.
Three dimensional objects are very popular but negatively affect
the accuracy and speed at which one can interpret a graphic in
most cases. In general, it is better to avoid them.
Basically,
3d scatterplots and
surface plots
are the only tolerated exceptions. Please don't build 3d barplots
or even worse, 3d pie charts.
3d distorts reality. Source
rgl
The rgl
package is the best tool to work in 3D from
R. Here is an illustration: a 3d scatterplot showing the
relationship between 3 numerical variables.
Note that
rgl
automatically builds interactive charts. Zooming
and rotating can indeed make the chart more insightful.
Trying zooming / rotating →
plotly
A surface plot shows the shape of a surface. It basically requires
a grid coordinates with a numeric variable attributed to each
position: its height. Plotly
allows to
build that kind of chart in minutes, and gives the interactivity
for free.
Trying zooming / rotating →