在基本 R 中是否有一种方法可以通过旋转 pch 点类型来修改它们?我需要一个直角三角形(其底边平行于 y 轴)。
x <- runif(5)
y <- runif(5)
plot(x, y, pch = 17, cex = 2) #is there a parameter for rotation?
或者,如何用实心三角形更改 arrows() 中的箭头?
plot(x, y, pch = "")
arrows(x, y, x-0.03, y, code = 1) #is there a parameter for the arrowhead symbol?
感谢您的帮助!
莎拉
最佳答案
至少在我的windows环境中,pch
几乎可以接受WGL4包含的所有字符。例如,BLACK RIGHT-POINTING POINTER 由 pch = -9658
、pch = -as.hexmode("25BA")
绘制,或pch =“\U25BA”
。您可以从 Using special characters from Windows Glyph List 4 (WGL4) in HTML 获取字符代码.
plot(rep(1, 9), pch = -c(9658, 9668, 9674, 9688, 9689, 9786, 9788, 9824, 9827), cex = 2)
关于R 绘图旋转点或实心箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40957167/