用直线将观测值连接到一个公共点(即(0,0))

时间:2020-09-08 08:18:24

标签: r ggplot2

我想用 ggplot2 将来自df的观测值与一个公共点(即中心点(0,0))连接起来。

x y
1 5 4
2 -4 -2
3 -1 5
4 2  -8

使用geom_point(),我得到以下信息。 Plot using geom_point()

现在,我想用连线将四个观测值与(0,0)的中心点连接起来,如下所示(不是用R制作的):

Illustration of what I would like to have

使用 ggplot2 可以做到吗?

1 个答案:

答案 0 :(得分:2)

我找到了解决方法:

min-width

基于@roland个问题的评论的答案。