Open maia-sh opened 3 years ago
It looks like you can solve this particular issue by specifying the axis you want to change like this.
library(dplyr)
library(ggplot2)
library(ggtext)
mtcars %>%
ggplot(aes(x = mpg, y = cyl)) +
geom_point() +
labs(
title = "I <span style='color:blue'>love</span> cars",
x = "Look at this <span style='color:red'>mpg</span>!"
) +
theme(
plot.title = element_markdown(),
axis.title.x = element_markdown()
)
Thank you for this wonderful package! I am trying to add colors with html to title and axis labels.
plot.title = element_markdown()
works, howeveraxis.title = element_markdown()
does not. Based on theelement_markdown()
document I believe this should work for alltext
.Created on 2021-02-10 by the reprex package (v0.3.0)