考虑以下轨迹:
有没有一种方法可以从箭头定义本身中排除
test = data.frame(x = c(9500, 25500, 47500), y = c(10.03, 7.81, 0.27))
我想使用ggplot2
将此绘制为路径,并用箭头标识方向:
ggplot(test) + aes(x = x, y = y) +
geom_path(size = 1,
arrow = arrow(type = "open", angle = 30, length = unit(0.1, "inches")))
这看起来很好。但是,如果我想使用虚线,箭头也会用虚线绘制,看起来很糟糕:
ggplot(test) + aes(x = x, y = y) +
geom_path(linetype ="dashed", size = 1,
arrow = arrow(type = "open", angle = 30, length = unit(0.1, "inches")))
有没有一种方法可以从箭头定义本身中排除
linetype
美学属性?
segmentsGrob
绘制线和箭头,并且只需要一个gpar
参数集。不确定如何在不修复grid的情况下解决此问题。 - joran