0

I have this issue where upon passing ggplot(data.frame(label = "corr:", corr = 1)) + geom_text(aes(x = factor(1), y = factor(1), label = paste(label, corr), color = label), family = "mono") + guides(color = FALSE) + theme_void() I am unable to view the plot the font is not showing up as in: enter image description here

I stumbled upon this due to a response in this question

R version 4.0.1 (2020-06-06) on x86_64-pc-linux-gnu

ggplot2 version 3.3.1

mogad0n
  • 41
  • 5

1 Answers1

0

changing to family="sans" fixed this issue for me (on Ubuntu 20.04, R v 4.0.2):

library(ggplot2)
ggplot(data.frame(label = "corr:", corr = 1)) + 
  geom_text(aes(x = factor(1), y = factor(1), label = paste(label, corr), 
            color = label), family = "sans") + 
  guides(color = FALSE) + theme_void()

see also my answer to this question

brian avery
  • 403
  • 2
  • 8