简体   繁体   English

RGL软件包散点图标签

[英]rgl package scatterplot labels

I seem to be having problems adding a title and axis labels in the rgl package. 我似乎在rgl包中添加标题和轴标签时遇到问题。 Here's a minimum working example: 这是一个最小的工作示例:

> plot3d(x = c(1,2,3,1), y = c(2,3,1,4), z = c(2,3,4,5), type = 's', size =1)
> decorate3d(main = "My Plot")

I see neither labels (which should be set by default in decorate3d) nor My Plot . 我既看不到标签(应该在decorate3d中默认设置)也看不到My Plot

decorate3d adds labels to an existing plot, so in your example decorate3d在现有图上添加标签,因此在您的示例中

plot3d(x = c(1,2,3,1), y = c(2,3,1,4), z = c(2,3,4,5), type = 's', size =1)

creates a plot with xlab = 'c(1,2,3,1)', ylab = ' c(2,3,1,4)' etc 使用xlab ='c(1,2,3,1)',ylab ='c(2,3,1,4)'创建图

decorate3d then adds the default values ( x , y , z ) in addition to the original labels (as it is writing on the current plot). decorate3d然后在原始标签上添加默认值( xyz )(因为它正在当前图上书写)。

If you want use decorate3d to label the axes, it would be safer to set them as '' in the original call to plot3d 如果要使用decorate3d标记轴,则在对plot3d的原始调用中将它们设置为''是更安全的

eg 例如

plot3d(x = c(1,2,3,1), y = c(2,3,1,4), z = c(2,3,4,5), type = 's', size =1,
       xlab = '', ylab = '', zlab = '')

## then 
decorate3d(main = "My Plot")
## will work as you wish.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM