Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using expressions in plot text generates warnings #178

Open
plantarum opened this issue Nov 22, 2021 · 0 comments
Open

Using expressions in plot text generates warnings #178

plantarum opened this issue Nov 22, 2021 · 0 comments

Comments

@plantarum
Copy link

To add italics, or other fancy symbols, to the text on a plot, I use expression:

plot(1:10, main = expression(italic("Italic Title")))

This generates a plot with the title in italics. If I use such a plot in cowplot, it generates warnings:

italic_plot <- function(){
  plot(1:10, main = expression(italic("Italic Title")))
}

plot_grid(italic_plot, italic_plot)
> plot_grid(italic_plot, italic_plot)
Warning in is.na(x) :
  is.na() applied to non-(list or vector) of type 'expression'
Warning in is.na(x) :
  is.na() applied to non-(list or vector) of type 'expression'

Depending on the complexity of the panels I'm preparing, this can generate a bit of noise in the terminal. Is there someway to avoid this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant