我正在修改基本 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,但我想看看它是否可以在基础 R 中完成。
最佳答案
关于r - 如何调整基本 R 中 pch 绘图点轮廓的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55433423/