Closed burchill closed 3 years ago
I noticed that when I used ggthemes::theme_economist() on a plot with a secondary x-axis at the top of the plot, the text labels for that top axis overlap with the top-edge of the plot. Example below:
ggthemes::theme_economist()
library(ggplot2) data.frame(x=rnorm(20),y=rnorm(20)) %>% ggplot(aes(x=x, y=y)) + geom_point() + scale_x_continuous(sec.axis = dup_axis(trans=~.)) + ggthemes::theme_economist()
This seems to be fixed when I add theme(axis.text.x.top = element_text(vjust = 0, margin = margin(b = base_size, unit = "pt")) to the theme.
theme(axis.text.x.top = element_text(vjust = 0, margin = margin(b = base_size, unit = "pt"))
Thanks for the example and code! I fixed this upcoming version.
I noticed that when I used
ggthemes::theme_economist()
on a plot with a secondary x-axis at the top of the plot, the text labels for that top axis overlap with the top-edge of the plot. Example below:This seems to be fixed when I add
theme(axis.text.x.top = element_text(vjust = 0, margin = margin(b = base_size, unit = "pt"))
to the theme.