Skip to contents

Create a formula for plotmath plot annotation from a measure object.

Usage

plot_math(x, sub = substitute(x))

Arguments

x

a measure object or its units()

sub

the main label, passed to format()

Value

A formula obeying plotmath syntax rules

Examples

x <- measure(1:5, "k|m s^-1")
plot_math(x)
#> x ~ `/` ~ km ~ s^-1
#> <environment: 0x5566ecefc0f0>
plot(x)

plot(x, ylab = plot_math(x, "Speed"))