目前主要使用ggplot2做一些數(shù)據(jù)可視化的分析,但是ggplot2有個(gè)很大的缺陷是不支持3D作圖,所以需要查找其他替代方案。 下面找到的兩個(gè)替代方案不錯(cuò),親測(cè)可行,記錄于此。
交互3D library(rgl) with(mtcars,{ plot3d(wt, disp, mpg, col="red", size=3) }) 效果圖
靜態(tài)3D library(scatterplot3d) with(mtcars,{ scatterplot3d(wt, # x-axis disp, # y-axis mpg, # z-axis main="3D Scatterplot") }) 效果圖
參考資料:http://www./graphs/scatterplot.html
|
|