繁体   English   中英

使用scatterplot3d包向3d图添加另一个尺寸

[英]adding another dimension to a 3d plot with scatterplot3d package

我正在使用包scatterplot3d处理3d图形,但是我需要图形的另一个维度。 根据第四个变量的数值,我想增加散点图中每个点的大小。 可能吗?

我的情节代码是:

    library(scatterplot3d)
    with(masad, {
    s3d <- scatterplot3d(HLC, cites, E.publications, 
                   color=title, pch=19, 
                   angle=20,
                   main="English",
                   xlim=c(0,1),
                   xlab="HLC",
                   ylab="cites",
                   zlab="E.publications")
                  s3d.coords <- s3d$xyz.convert(HLC, cites, E.publications) 
                  legend("topright", inset=.10,
                  bty="n", cex=.5,       
                  title="title", 
                  c("none/else","doctor","professor") , fill=c("red",         
                  "blue", "darkgreen"))

     }) 

这是一种方法

library(scatterplot3d)
library(plotrix) # for rescale()
with(mtcars, 
     scatterplot3d(disp, 
                   hp, 
                   wt, 
                   cex.symbol = rescale(qsec, c(.5, 5)), # .5 <= size <= 5
                   color = "#00000066", # overplotting, so add transparency 
                   pch = 19)
)

在此处输入图片说明

暂无
暂无

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

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