Closed goaltergeist closed 3 years ago
Use the html entity, %
.
library(tidyverse)
library(ggtext)
mtcars %>%
ggplot(aes(mpg, cyl/8, color = am)) +
geom_point() +
labs(title = "A working _ggtext_ **markdown** title.") +
scale_x_continuous(name = "% of Maximum **Cylinders** (8)") +
theme(plot.title = element_markdown(), axis.title.x = element_markdown())
Created on 2021-07-12 by the reprex package (v1.0.0)
Hello, thank you for this amazing package. I am encountering a behavior where
element_markdown()
doesn't renderggplot2
labels if the label string begins with a percent symbol, i.e.%
.A plot with working x axis label and title, formatted in Markdown:
The same plot, but this x axis label doesn't print as it begins with
%
:If
axis.title.x
is set toelement_text()
, the label beginning with%
is displayed:Lastly, escaping the percent symbol does not work because the
\
is escaped rather than the%
:Is there any way for a label string to begin with
%
?