X and Y scales in ggplot

Hello Guys!
Im ploting a series with the following code:

ggplot(anual) +
aes(x = Year, y = valor, colour = tipo de deficit) +
geom_line(size = 1L) +
scale_color_brewer(palette = "Set1") +
labs(x = "Años", y = "% del PIB", title = "Deficit ", caption = "BCE del Ecuador", color = "Tipo de déficit") +
theme_gray()+theme(plot.title = element_text(face ="bold", size=15,hjust=0.5))

BUT I NEED TO SEE IN THE PLOT ALL THE YEARS OF THE VARIABLE X (since 2001 to 2020, year by year). What should I add to the code?

Add this:

+ scale_x_continuous(breaks = 2001:2020)
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.