I want to organize the boxplot in an order of His, 2030, 2060, 2090. In the following code, "His" is going at the end regarding the order.
ggplot(data_NE_Tmax,aes(x=Senario_Name, y=Value, fill = SSP)) +
stat_boxplot( aes(Senario_Name,Value),
geom='errorbar', linetype=1, width=0.5)+
geom_boxplot(varwidth = FALSE, alpha = 0.8,
position = position_dodge(0.5), lwd = 0.6, outlier.shape = NA)+
scale_fill_manual(values = c("#FFFFCC","#FF9933","blue"))+
stat_summary(fun.y=mean, colour="#DC143C", geom="point", shape=20, size=2.5,show_guide =
FALSE)+
theme_bw() +
theme(text = element_text(family = "serif"))+
facet_grid(~RegionC,scales='free')+
theme(strip.text.x = element_text(size = 13))+
theme (legend.position="none",
plot.title = element_text(color = "grey20", size = 12, hjust = .5, face = "plain",
margin= margin(10,10,10,10)),
axis.text.x = element_text(color = "grey20", size = 11, angle = 0, hjust = .5, vjust = .5, face = "plain"),
axis.text.y = element_text(color = "grey20", size = 11, angle = 0, hjust = .5, vjust = .5, face = "plain"),
axis.title.x = element_text(color = "grey20", size = 11, angle = 0, hjust = .5, vjust = 0, face = "plain"),
axis.title.y = element_text(color = "grey20", size = 11, angle = 90, hjust = .5, vjust = .5, face = "plain"))+
labs(y=expression(plain(paste("%" , sep=""))))+
labs(title="Drought Duration", x = "")+
scale_x_discrete(labels=c("SSP_His" = "His",
"SSP_45_30" = "2030", "SSP_45_60" = "2060","SSP_45_90" = "2090",
"SSP_85_30" = "2030", "SSP_85_60" = "2060","SSP_85_90" = "2090"))+
scale_y_continuous(limits = c(-20, 50), breaks= scales::breaks_width(10))