asTheEconomist(xyplot(window(sunspot.year, start = 1900),
main = "Sunspot cycles", sub = "Number per year",
scales = list(y = list(relation = "same", axs = "i"))))
.featured_example <- TRUE
trellis.last.object() +
layer_(panel.xblocks(x, x >= 1980, col = "#6CCFF6", alpha = .5)) +
layer(panel.text(1988, 180, "Forecast", font = 3, pos = 2))
asTheEconomist(
barchart(Titanic[,,,"No"], main = "Titanic deaths", layout = 1:2,
sub = "by sex and class", auto.key = list(columns = 2)),
vertical = TRUE)
asTheEconomist(
dotplot(VADeaths, main = "Death Rates in Virginia (1940)",
auto.key = list(x = .9, y = .1, corner = c(1,0))),
type = "b", with.bg = TRUE)
dotplot(VADeaths, auto.key = TRUE, type = "b",
par.settings = theEconomist.theme(with.bg = TRUE))
asTheEconomist(
densityplot(~ height, groups = voice.part, data = singer,
subset = grep("1", voice.part), plot.points = FALSE)) +
glayer(d <- density(x), i <- which.max(d$y),
ltext(d$x[i], d$y[i], paste("Group", group.number), pos = 3))
Run the code above in your browser using DataLab