Skip to content

Using expressions in plot text generates warnings #178

@plantarum

Description

@plantarum

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions