1
The database I’m reading is as follows:
Trimestre PIB
1º T 2018 0.005
2º T 2018 0.000
3º T 2018 0.005
4º T 2018 0.001
1º T 2019 -0.001
2º T 2019 0.004
I made a bar Plot with the following code:
library(ggplot2)
library(scales)
ggplot(dados, aes(x=Trimestre, y=PIB)) +
geom_bar(aes(fill = Trimestre), stat="identity") +
theme_minimal()+
scale_y_continuous(labels = percent_format())+
geom_label(aes(label = percent(PIB)),
position = position_dodge(0.9), vjust=0.5, size=3.5,
hjust = 0.5)
And he returned to me the figure below.
The first question is: How to leave the x axis, where do the Quarters appear, in an orderly fashion? Ex: 1ºTrimestre 2018, 2ºTrimestre 2018, 3ºTrimestre 2018...
The second question is: How to change the percentage so that it reads only with a decimal place after the comma?
Thanks!
Great! Gave it right! Thank you very much!
– Letícia Marrara
You know how to do the same idea of ordering the y-axis, but now with annual and monthly data, for a line graph as well, not just bar data?
– Letícia Marrara
@Letíciamarrara Just seeing the data...
– Rui Barradas