library(ggplot2)
library(tidyr)
#faili sisselugemine ja andmete formaadi korrigeerimine
J415=read.csv("PT4-T4.1-J4.1.5.csv",header=TRUE, encoding ="UTF-8")[,1:6]
names(J415)=c("Sugu","<=54","55-64","65-74","75-84","85+")
J415=J415[2:3,]
J415=pivot_longer(J415,2:6)

#joonis
ggplot(J415)+
  geom_col(aes(x=name,y=value,fill=Sugu),pos=position_dodge(0.9),width=0.7)+
  theme_minimal()+
  theme(text = element_text(color="#668080"),axis.text=element_text(color="#668080"))+
  scale_fill_manual(values=c("#323E4E","#ff3600"))+
  xlab("")+
  ylab("%")+
  theme(legend.title = element_blank())