【发布时间】:2020-10-23 17:45:58
【问题描述】:
我正在尝试创建一个类似于one 的连接散点图,这有更多explanation
基本上,我试图在一张图表上显示劳动力中人数的下降,以人数衡量。第二张图将显示同一时期内失业率的变化。
这是我的代码:
# ggplot2 call:
Unemployment_Outflows %>%
ggplot( aes(x=unemployment_rate, y=labor, label=year)) +
# Custom the Y scales:
scale_y_continuous() +
geom_line( color="grey") +
geom_point(shape=21, color="black", fill="#69b3a2", size=3)
geom_segment(aes(
xend=c(tail(unemployment_rate, n=-1), NA),
yend=c(tail(labor, n=-1), NA)
)
)
“geom_path:每个组只包含一个观察值。是否需要调整组审美?”
年 改变 change_perc 失业率 劳动
*年 (chr) 劳动力失业率 (dbl) (dbl)
2015 年第四季度 8416681 0 NA
2016 年第四季度 8492965 12.34717
2017年第四季度 7907511 12.83452
2018年第四季度 6895514 12.74767
2019年第四季度 6437891 12.01787
2020 年第三季度 6409070 15.44732
【问题讨论】:
标签: r ggplot2 data-visualization tidyverse scatter-plot