Open CosmicOutlaw opened 5 months ago
Following code with ggtext library loaded
theme_minimal() + theme( axis.text.x = element_text(face = "bold"), axis.title.x = element_text(face = "bold"), axis.text.y = element_text(face = "bold"), axis.title.y = element_text(face = "bold"), legend.title = element_text(face = "bold"), axis.text.x.top = element_markdown(angle = 45), axis.title.x.top = element_blank(), plot.title = element_text(margin = margin(b = 10)), plot.subtitle = element_text(margin = margin(b = 20)), panel.grid.major = element_line(size = 1), panel.grid.minor = element_line(size = 1) ) + labs( title = "Varieties of Democracy across U.S. Presidents",
turns into this crooked text.
ggtext can't render element_markdown with angle argument set to higher than 0.
In general, I would recommend using guides(x = guide_axis(angle = 30)) to set angled axis labels, rather theme(). Setting them with theme is an outdated and unpredictable approach.
guides(x = guide_axis(angle = 30))
theme()
Following code with ggtext library loaded
turns into this crooked text.
Leaving angle at 0 or removing it entirely renders the text flawlessly.
ggtext can't render element_markdown with angle argument set to higher than 0.