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
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
# 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"
))