ggplot2散点图中错误的Y轴标签顺序

时间:2021-02-25 02:48:50

标签: r ggplot2 scatter-plot

所以我有这个散点图,我想比较 CO2 排放量,这是我的问题,在 Y 轴上,标签的顺序错误,甚至绘图也是错误的,因为它看起来像这样:

enter image description here

这是脚本:

ggplot(data = emisiones_data) +
geom_point(mapping = aes(x = Año, y = Emisiones , color=Región),
           size=1.65) +
scale_y_discrete(guide = guide_axis(check.overlap = TRUE)) +
scale_x_continuous(breaks = seq(1965,2020, 5)) +
ggtitle("Emisiones de Dióxido de Carbono",
        subtitle = "Millones de toneladas (1965-2019)") +
xlab("")+
ylab("Millones de toneladas")+
theme(axis.text.x = element_text(angle = 90),
      plot.title = element_text(color="#993333", size=15, face="bold.italic"),
      axis.title.y = element_text( size=12, face="bold")) 

这是 df 的样子:

enter image description here

我能做什么?

0 个答案:

没有答案