我需要用R做一个增长-份额矩阵(BCG矩阵),我不知道是否可以用R做这张图。我将获得一个图形,如下所示的enter link description here
谢谢你!
发布于 2013-04-15 21:37:21
下面是一个使用R中一些基本绘图函数的示例:
示例:
set.seed(1)
n = 10
x <- runif(n, min=0, max=2)
y <- runif(n, min=8, max=24)
z <- runif(n, min=0, max=100)
#z to cex function
a <- 1
b <- 0.02
z.cex <- a + b*z
example.cex <- seq(1,3,0.5)
example.z <- (example.cex - a)/b
example.z
plot(x, y, pch=21, bg="orange", col="red", cex=z.cex, lwd=2, bty="n", xaxt="n", yaxt="n", xlab="", ylab="")
grid()
axis(1, at=seq(0,2,0.5), pos=16, col="green4", lwd=3)
axis(2, at=seq(8,24,4), pos=1, col="green4", lwd=3)
legend("topright", legend=c(example.z), pch=21, pt.bg="orange", col="red", pt.cex=example.cex, title="sales vol.", bg="white")

https://stackoverflow.com/questions/16015103
复制相似问题