R/convert.R

Defines functions grconvertY grconvertX ty tx

# Handle log axes

tx <- function(x, par) {
    if (par$xlog && !is.null(x)) {
        log10(x)
    } else {
        x
    }
}

ty <- function(x, par) {
    if (par$ylog && !is.null(x)) {
        log10(x)
    } else {
        x
    }
}

## Make use of graphics::grconvert[X|Y]()

grconvertX <- function(x, from, to) {
    dev.set(recordDev())
    on.exit(dev.set(playDev()))
    graphics::grconvertX(x, from, to)
}

grconvertY <- function(x, from, to) {
    dev.set(recordDev())
    on.exit(dev.set(playDev()))
    graphics::grconvertY(x, from, to)
}

Try the gridGraphics package in your browser

Any scripts or data that you put into this service are public.

gridGraphics documentation built on Dec. 15, 2020, 5:10 p.m.