scatter3D cex.clab 和 rgl

scatter3D cex.clab and rgl

我正在努力解决如何在 rgl 设备中增加颜色键标题的字体大小,该设备显示使用 plot3D 包中的 scatter3D() 创建的绘图。我在下面包含了一些代码,证明 cex.clab 选项会影响图形设备中颜色键标题的字体大小,但不会影响 rgl 设备。对于如何增加 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)

据我所知,plotrgl() 无法正确处理某些参数。我认为制作一个没有标签的图表并使用 rgl 函数添加它们会更好,例如 title3d() and/or text3d().

这是我的例子;

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