R 绘制旋转点或填充箭头
R plot rotated points or filled arrowhead
在基本 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 中有没有一种方法可以通过旋转来修改 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)