It is often desirable to minimize ink in a plot. I have a faceted plot (facet_wrap
) and would like to remove as much ink as possible yet maintain readability. I have set it up as I'd like except the x and y axis is not present for the facets (subplots) unless on the far left or bottom. With so much ink removed I believe the eye needs these cues and am asking how to put the x and y axis in all plots within a facet_wrap
. Below is my code thus far, the current output and the deired output (red lines are the desired add in):
library(ggplot); library(grid)
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
facet_wrap(~carb) +
theme(panel.grid = element_blank(),
panel.background = element_rect(fill = "white", colour = "black"),
panel.border = element_rect(fill = NA, colour = "white"),
axis.line = element_line(),
strip.background = element_blank(),
panel.margin = unit(2, "lines"))
Current Plot
Desired Plot
This should simplify things considerably:
library('ggthemes')
ggplot(mtcars, aes(mpg, hp)) + geom_point() + facet_wrap(~carb, scales='free') +
theme_tufte() + theme(axis.line=element_line()) +
scale_x_continuous(limits=c(10,35)) + scale_y_continuous(limits=c(0,400))