How to draw a nice arrow in ggplot2

后端 未结 4 1185
暖寄归人
暖寄归人 2020-12-08 19:36

I am creating a ggplot chart where I want to have some arrows between two points. The main task is easily done with geom_line(arrow = arrow()). How

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 20:03

    There is a very simple, but somewhat "hacky" solution to this.

    The idea is to draw the lines first (at the desired thickness, but no arrowheads), but a little bit shorter (can be calculated in some cases). Then just draw a second line, without changing the size with arrowheads. The resulting overlay will look the way you want.

提交回复
热议问题