Skip to content

theme argument in yplot affects other plots #7

@tverbeke

Description

@tverbeke

Specifying the theme argument in one single plot affects all subsequent plots. It may be desirable to allow for general themes and plot-specific themeing.

library(imp.lattice)

if (interactive()) x11() else pdf()
.yagpenv$backend <- graphics_primitives()

data(pressure)

x11()

.yagpenv$theme <- yagp.theme("default")
.yagpenv$theme$background
# $col
# [1] "#eeeeee"


.yagpenv$theme <- yagp.theme("trellis")
.yagpenv$theme$background
# $col
# [1] "#909090"


data(pressure)
p <- yplot(data = pressure,
    panel.vars = elist(x = temperature, y = pressure),
    panel = ypanel.xyplot(col="blue") + 
        ypanel.abline(h = 200, col = "orange", lwd = 2),
    pch = 19, xlab = "Temp (Celsius)", ylab = "Pressure (mm Hg)",
    theme = yagp.theme("default"), # permanently sets the theme
)
p

.yagpenv$theme$background
# $col
# [1] "#eeeeee"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions