

   units {base}                                 R Documentation

   GGrraapphhiiccaall UUnniittss

   DDeessccrriippttiioonn::

        `xinch' and `yinch' convert the specified number of
        inches given as their arguments into the correct units
        for plotting with graphics functions.  Usually, this
        only makes sense when normal coordinates are used,
        i.e., no `log' scale (see `par(log=..)').

        `xyinch' does the same for a pair of numbers `xy',
        simultaneously.

        `cm' translates inches in to cm (centimeters).

   UUssaaggee::

        xinch(x=1, warn.log=TRUE)
        yinch(y=1, warn.log=TRUE)
        xyinch(xy=1, warn.log=TRUE)
        cm(x)

   AArrgguummeennttss::

        x,y: numeric vector

   EExxaammpplleess::

        all(c(xinch(),yinch()) == xyinch()) # TRUE
        xyinch()
        xyinch #- to see that is really   delta{"usr"} / "pin"

        cm(1)# = 2.54

        ## plot labels offset 0.12 inches to the right
        ## of plotted symbols in a plot
        data(mtcars)
        attach(mtcars)
        plot(mpg, disp, pch=19, main= "Motor Trend Cars")
        text(mpg + xinch(0.12), disp, rownames(mtcars),adj=0, cex = .7, col='blue')
        detach(mtcars)

