Is it possible to rotate a plot in R (base graphics)?

后端 未结 6 1849
灰色年华
灰色年华 2020-11-30 12:45

I searched for this and found that with {grid} there are ways to rotate an image, and that for some plots you can play with their rotation (for example plot(x,y) instead of

6条回答
  •  天涯浪人
    2020-11-30 13:14

    Spinning 3D Scatterplots

    You can also create an interactive 3D scatterplot using the plot3D(x, y, z) function in the rgl package. It creates a spinning 3D scatterplot that can be rotated with the mouse. The first three arguments are the x, y, and z numeric vectors representing points. col= and size= control the color and size of the points respectively.

    # Spinning 3d Scatterplot
    library(rgl)
    
    plot3d(wt, disp, mpg, col="red", size=3)
    

提交回复
热议问题