26

RGL を使用した 3D プロットがあります。色を使用して同一のプロットを作成し、変数の分布を強調したいと思います。これを行うには、同一のプロットを作成したいのですが、プロットの向きを見つけて設定するにはどうすればよいですか?

予備プロットを作成したら、それを動かして適切な表示角度を見つけます。その角度を保存して、将来のプロット スクリプトに組み込みたいと思います。誰でもこれを行う方法について提案がありますか?

library(rgl)
plot3d(iris) 
#play with the plot to find a good angle
#save the angle for future plots
4

1 に答える 1

22

ベンのコメントは基本的にあなたの質問に答えます。expand.dotsこれは彼が書いたものに当てはまります ;)

## In an inital session:

library(rgl)
plot3d(iris) 

## Now move the image around to an orientation you like

## Save RGL parameters to a list object
pp <- par3d(no.readonly=TRUE)

## Save the list to a text file
dput(pp, file="irisView.R", control = "all")

.......

## Then, in a later session, to recreate the plot just as you had it:

library(rgl)
pp <- dget("irisView.R")
plot3d(iris)
par3d(pp)
于 2013-05-03T16:00:41.040 に答える