I made a faceted plot using ggplot as given below
suppressPackageStartupMessages({
library(tidyverse)
library(ggplot2)
})
myfiles1 = data.frame(
temp=sample(200,120),
month=rep(seq(1:12),10),
model="first"
)
myfiles2 = data.frame(
temp=sample(200,120),
month=rep(seq(1:12),10),
model="second"
)
df_final=rbind(myfiles1,myfiles2)
df_final=df_final %>%
mutate(month=month.abb[month])
df_final$month=factor(df_final$month,levels = month.abb)
ggplot(df_final, aes(y=temp, fill=model)) +
geom_boxplot()+
facet_wrap(~month, scale="free",strip.position = "top")+
theme_bw()+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(colour = "black"))+
theme(legend.position = "none")
Here, I want to insert the x-axis tick at the last row of the plots only as "first" and "second".
Thank you