Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Using themes, use axis.line
(Figure 8-24):
library(gcookbook)# For the data setp<-ggplot(heightweight,aes(x=ageYear,y=heightIn))+geom_point()p+theme(axis.line=element_line(colour="black"))
If you are starting with a theme that has a border around the plotting area,
like theme_bw(), you will also need
to unset panel.border (Figure 8-24, right):
p+theme_bw()+theme(panel.border=element_blank(),axis.line=element_line(colour="black"))