【发布时间】:2021-11-27 04:27:09
【问题描述】:
我有一个名为 crash_deaths_injuries_TA_pop 的数据框,看起来像:
| TA_name | Population |
|---|---|
| Gore | 34466 |
| Buller | 444444 |
| Cluth | 34455 |
我试图用条形图显示数据,但是,x 轴的比例搞砸了,我不知道该怎么做。我知道这一定很容易,但我是编码新手,所以我很挣扎。
这是我的条形图代码:
ggplot(crashes_deaths_injuries_TA_pop, aes(x = reorder(TA_name, Population), y = Population, fill = Population)) +
geom_col(alpha = 0.7) +
scale_fill_distiller(palette = "Reds", direction = 1) +
coord_flip() +
labs(x = "", y = "Population", fill = "Population",
title = "Populations of South Island TA's | 2018",
caption = "Data: Census 2018, StatsNZ") +
theme_minimal() +
theme(legend.position = "none")
我还想知道如何在每个 TA_name 的每个条的末尾添加一个像人口这样的数字
【问题讨论】:
-
是刻度还是科学记数法“搞砸了”? (参见例如stackoverflow.com/questions/5352099/…)
-
我已经删除了科学记数法,但现在我想编辑中断,这会是用中断命令吗?