2016-11-30 3 views
1

私は、plot3Dパッケージからscatter3D()を使って作成されたプロットを表示するrglデバイスのカラーキータイトルのフォントサイズを増やす方法に苦労しています。私はcex.clabオプションがグラフィックデバイスのカラーキータイトルのフォントサイズに影響するが、rglデバイスには影響しないことを示す以下のコードをいくつか挙げました。私はrglデバイスのカラーキータイトルのフォントサイズを増やす方法についての提案も感謝します。
おかげで、 デイブscatter3D cex.clabとrgl

library(plot3D); library(plot3Drgl) 
with(quakes, 
    scatter3D(x=long, y=lat, z=-depth, colvar=mag, pch=16, cex=1.5, 
    xlab="longitude", ylab="latitude", zlab="depth, km", 
    clab=c("Richter", "Magnitude"), main="Earthquakes off Fiji", 
    ticktype="detailed", theta=10, d=2, 
    colkey=list(length=0.5, width=0.5, cex.clab=1)) 
) 
plotrgl(lighting = TRUE, smooth = TRUE, cex=2) 

with(quakes, 
    scatter3D(x=long, y=lat, z=-depth, colvar=mag, pch=16, cex=1.5, 
    xlab="longitude", ylab="latitude", zlab="depth, km", 
    clab=c("Richter", "Magnitude"), main="Earthquakes off Fiji", 
    ticktype="detailed", theta=10, d=2, 
    colkey=list(length=0.5, width=0.5, cex.clab=2)) 
) 
plotrgl(lighting = TRUE, smooth = TRUE, cex=2) 

答えて

1

私の知る限り見るように、plotrgl()は、いくつかのパラメータを正しく扱うことはできません。ラベルなしでグラフを作成し、やtext3d()などのrgl関数を使用してグラフを追加する方が良いと思います。

これは私の例です。

library(plot3D); library(rgl); library(plot3Drgl) 

    ## example data (on my env, plotrgl(some_graph) crushes Rstudio, so I used volcano) 
volc <- reshape2::melt(volcano) 

with(volc, scatter3D(x = Var1, y = Var2, z = value, ticktype="detailed", pch=16, 
        xlab="longitude", ylab="latitude", zlab="depth, km", main="")) 
plotrgl(lighting = TRUE, smooth = TRUE, cex=2) 

    ## When graph is made, the left panel is focused 
title3d(main = "Earthquakes off Fiji", line=4, cex=2) 

    ## next3d() changes the focus into the right panel 
next3d(clear = F) 
title3d("Richter", cex = 2, line = 2) 
title3d("Magnitude", cex = 2, line = 0.8) 
    # text3d(0, 1, 1.2, "Richter", cex=2) # almost same 
    # text3d(0, 1, 1.1, "Magnitude", cex=2) 

next3d(clear = F) # if you want to refocus the left panel 

enter image description here

+0

ありがとう!これは素晴らしい作品です!なぜ私はこれを理解できなかったのか分かりません。 – dmwarn

関連する問題