0

For example, when I make a graph using the below code,

location=rep(c("A","B","C"),each=5)
nitrogen=rep(c(0,10,20,30,40), time=3)
yield=c(15,20,25,29,38,10,20,40,50,55,15,17,16,17,20)
dataA=data.frame(location, nitrogen, yield)

ggplot(data=dataA, aes(x=nitrogen, y=yield))+
  stat_smooth(method='lm', linetype=1, se=FALSE, formula=y~x, linewidth=0.5) +
  geom_point(color="black", size=4) +
  scale_x_continuous(breaks=seq(0,40,10), limits = c(0,40)) +
  scale_y_continuous(breaks=seq(0,60,10), limits = c(0,60)) +
  labs(x="N rate", y="Grain Yield") +
  facet_wrap(~location) +
  theme_classic(base_size=20, base_family="serif")+
  theme(axis.line=element_line(linewidth=0.5, colour="black"),
  strip.background= element_rect(color="white", size=0.5,linetype="solid"))+
  windows(width=5.5, height=5)

enter image description here

I want to draw the y-axis line in each panel, and also underline each panel title as below.

enter image description here

Could you let me know how to do that?

Thanks,

Jin.w.Kim
  • 599
  • 1
  • 4
  • 15

0 Answers0