graf4<-ggplot(DF,
aes(x=variable,y=value,color=paese)) +
geom_line(aes(linetype=paese,group=paese),size=2.5)+
theme_bw()+
labs(x="",y="")+
scale_colour_manual(values=c("darkorange1","darkorchid1","darkgreen","steelblue3","maroon2","grey2","yellow4",
"burlywood4", "chocolate"))+
scale_y_continuous(labels=fmt_dcimals(1))+
theme(panel.grid.major = element_line(colour = "grey",size=0.1)) +
theme(panel.grid.minor = element_line(colour = "white",linetype="dashed",size=0.1)) +
theme(strip.text.y=element_text(angle=0))+
theme(axis.text.x = element_text(angle=90,vjust=0.5,size=12),
axis.text.y = element_text(size=12),
legend.position = "bottom",
legend.box="horizontal",
legend.box.background=element_rect(),
legend.title = element_blank(),
legend.text=element_text(size=12))+
guides(col=guide_legend(nrow=1,byrow=TRUE))
print(graf4)
The code above work but my problem is that the tick (label) on x axis are too many and I would like to have less tick on the graph. For example have a breaks every 3 observation.
Note that VARIABLE isn't date format but character format. I dont want, for some other reason date format.
I tried with scale_x_discrete, scale_x_continuous and other instruction with parameters or not but I cant have on the x axis every 3 observation tick, for example.
I know that for numeric type on the x axis I cant set a breaks, but I don't know hot to set for character value type.
Variable * value * paese
#1 1999 q1 12 UK
#2 1999 q2 15 UK
#3 1999 q3 55 UK
#4 1999 q4 67 UK
#5 1999 q1 12 DE
#6 1999 q2 15 DE
#7 1999 q3 55 DE
#8 1999 q4 67 DE
#9 2000 q1 33 UK
#10 2000 q2 23 UK
#11 2000 q3 65 UK
#12 2000 q4 34 UK
#13 2000 q1 33 DE
#14 2000 q2 23 DE
#15 2000 q3 65 DE
#16 2000 q4 34 DE
# .... . ..
#45 2023 q1 23 UK
#46 2023 q2 11 UK
#47 2023 q3 23 UK
#48 2023 q1 23 DE
#49 2023 q2 11 DE
#50 2023 q3 23 DE