3D graphics

Previously, we described the essentials of R programming and provided quick start guides for importing data into R as well as visualizing data using R base graphs.

This chapter describes how to create static and interactive three-dimension (3D) graphs. We provide also an R package named graph3d to easily build and customize, step by step, 3D graphs in R software.

Simple 3D Scatter Plots: scatterplot3d Package

  • Install and load scaterplot3d
  • Prepare the data
  • The function scatterplot3d()
  • Basic 3D scatter plots
  • Change the main title and axis labels
  • Change the shape and the color of points
  • Change point shapes by groups
  • Change point colors by groups
  • Change the global appearance of the graph
    • Remove the box around the plot
    • Add grids on scatterplot3d
  • Add bars
  • Modification of scatterplot3d output
    • Add legends
    • Add point labels
    • Add regression plane and supplementary points

Read more: —> Simple 3D Scatter Plots: scatterplot3d Package.

Advanced 3D Graphs: plot3D Package

  • Install and load plot3D package
  • Prepare the data
  • Scatter plots
    • Basic scatter plot
    • Change the type of the box around the plot
    • Change the color by groups
    • Change the position of the legend
    • 3D viewing direction
    • Titles and axis labels
    • Tick marks and labels
    • Add points and text to an existing plot
  • Line plots
    • Add confidence interval
    • 3D fancy Scatter plot with small dots on basal plane
    • Regression plane
  • text3D: plot 3-dimensionnal texts
  • text3D and scatter3D
  • 3D Histogram
  • scatter2D: 2D scatter plot
  • text2D
  • Interactive plot

Read more: —> Advanced 3D Graphs: plot3D Package.

Interactive 3D Scatter Plots

  • Install and load required packages
  • Prepare the data
  • The function scatter3d
  • Basic 3D scatter plots
  • Plot the points by groups
    • Default plot
    • Remove the surfaces
    • Add concentration ellipsoids
    • Change point colors by groups
  • Axes
    • Change axis labels
    • Remove axis scales
    • Change axis colors
  • Add text labels for the points
  • Export images
3d scatter plot rgl

3d scatter plot rgl

Read more: —> Interactive 3D Scatter Plots.

Guide to RGL 3D Visualization System

  • Install the RGL package
  • Load the RGL package
  • Prepare the data
  • Start and close RGL device
  • 3D scatter plot
    • Basic graph
    • Change the background and point colors
    • Change the shape of points
  • rgl_init(): A custom function to initialize RGL device
  • Add a bounding box decoration
  • Add axis lines and labels
  • Set the aspect ratios of the x, y and z axes
  • Change the color of points by groups
  • Change the shape of points
  • Add an ellipse of concentration
  • Regression plane
  • Create a movie of RGL scene
  • Export images as png or pdf
  • Export the plot into an interactive HTML file
  • Select a rectangle in an RGL scene
  • Identify points in a plot
  • R3D Interface
  • RGL functions
    • Device management
    • Shape functions
    • Scene management
    • Setup the environment
    • Appearance setup
    • Export screenshot
    • Assign focus to an RGL window
RGL movie 3d

RGL movie 3d

Read more —> Guide to RGL 3D Visualization System.


This analysis has been performed using R statistical software (ver. 3.2.4).

Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!

This page has been seen 59467 times