Graphics Reference
In-Depth Information
Figure 8-24. Left: scatter plot with axis lines; right: with theme_bw(), panel.border must also be
made blank
Discussion
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" ))
If the lines are thick, the ends will only partially overlap ( Figure 8-25 , left). To make them fully
overlap ( Figure 8-25 , right), set lineend="square" :
# With thick lines, only half overlaps
p + theme_bw() +
theme(panel.border = element_blank(),
axis.line = element_line(colour = "black" , size = 4 ))
# Full overlap
p + theme_bw() +
theme(panel.border = element_blank(),
axis.line = element_line(colour = "black" , size = 4 , lineend = "square" ))
Search WWH ::




Custom Search