【发布时间】:2019-08-21 08:07:45
【问题描述】:
我正在修改基本 R 图中的 cex 选项,以调整我的图以用于演示幻灯片。我似乎能够调整大多数尺寸方面,但我注意到当情节点变大时,我的 pch 点的轮廓颜色并没有变得更粗/更厚。因此,情节点越大,轮廓颜色越不明显。
在各种 cex 选项(cex、cex.main、cex.sub、cex.axis、cex.lab)上找到了许多网站(和 SO 帖子),但似乎没有一个正在调整 pch 绘图点。
我知道只有某些 pch 符号(21 到 25)可以与填充颜色和轮廓一起使用。我的示例代码使用 21(圆圈)。
data("mtcars") # test data
summary(mtcars[c("hp","mpg")]) # to find on min & max values to set plot limits
# set general features used for multiple plots
par(bg="blue", fg="red", col="yellow", col.axis="white", col.lab="white", bty="n", cex=1.5)
# test plot to illustrate, cex used here to further adjust plot points from par setting
plot(mtcars$hp, mtcars$mpg, ylim=c(10, 35), xlim=c(50, 340), pch=21, bg="red", cex=2)
我是否遗漏了有关 cex 的某些内容,或者是否有其他解决方案而不使用 ggplot?如果有选项我不反对ggplot,但我想看看它是否可以在base R中完成。
【问题讨论】: