I want to move the y-axis tick labels to the left (as i did with the axis.text.y to the bottom).
The weird thing is with hjust = -2.5
, although the theme_set()
part runs without errors, the text on the y-axis does not get moved. However, vjust = 2
does affect the y labels just fine.
I am creating a bug with all my options in the theme?
library(tidyverse)
library(ggplot2)
theme_set(
theme_classic() +
theme(
axis.ticks.length = unit(-0.25, "cm"),
axis.text.x = element_text(vjust = -2.5),
axis.text.y = element_text(hjust = -2.5), # this does not do anything.
# axis.text.y = element_text(vjust = -2.5), # while vjust does affect the text placement.
axis.line = element_blank(),
panel.grid.major.y = element_line(linetype = 2),
plot.title = element_text(hjust = 0.5),
text = element_text(family = "serif"),
legend.justification = c(1, 1),
legend.position = c(1, 1),
panel.border = element_rect(fill = NA, size = 2)))
mpgdat <- tibble(mtcars)
mpgdat %>% ggplot(aes(disp, mpg)) + geom_point()