使用 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)
)
我正在使用包 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)
)