library(ggplot2)
library(tidyr)
library(scales)
#faili sisselugemine ja andmete formaadi korrigeerimine
J222=read.csv("PT2-T2.2-J2.2.2.csv",header=TRUE, encoding ="UTF-8")
J222=pivot_longer(J222,c("Boys","Girls"))
names(J222)=c("Year","Gender","Protsent")
J222$Year=as.factor(J222$Year)
#joonis
ggplot(J222,aes(x=Year,y=Protsent,col=Gender))+
geom_point(cex=3)+
geom_line(aes(col=Gender,group=Gender),linewidth=1)+
theme_minimal()+
theme(legend.position = "bottom")+
ylab("Share of young people (%)")+
scale_y_continuous(limits=c(0,50))+
scale_color_manual(values=c("#6666cc","#FF3600"))+
theme(text = element_text(color="#668080"),axis.text=element_text(color="#668080"))
