-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
ggtext() modifies ggplot's default behavior, which is to display the label 'NA' in axis texts.
For example:
library(tidyverse)
library(ggtext)
tibble(
group = c("group1", "group2", "group3", NA, "**total**"),
value = c(-0.5, 0.5, 2, 3, 2)
) %>%
ggplot(aes(value, group)) +
geom_col(alpha = 0.5, fill = "purple") +
theme(
axis.text.y = element_markdown()
)
VS
tibble(
group = c("group1", "group2", "group3", NA, "**total**"),
value = c(-0.5, 0.5, 2, 3, 2)
) %>%
ggplot(aes(value, group)) +
geom_col(alpha = 0.5, fill = "orange2")
Is there any way to change element_markdown()'s behavior so that it displays the 'NA' label without first transforming the missing NA value into a string modality “NA”? The way ggplot handles NAs by default is very useful to me (automatic color, etc), and using ggtext() then requires major transformations in my functions.
Thank you!
Metadata
Metadata
Assignees
Labels
No labels