Description Usage Arguments Details Author(s) References See Also Examples
Uses colors, drawing styles, axis settings, etc, to produce plots inspired by those in The Economist magazine. (http://www.economist.com/).
1 2 3 4 5 6 7 8 9 10 11 12 13 | theEconomist.theme(win.fontfamily = NULL,
with.bg = FALSE, box = "black", ...)
theEconomist.opts()
asTheEconomist(x, ...,
type = "l",
ylab = expression(NULL),
xlab = expression(NULL),
par.settings =
theEconomist.theme(with.bg = with.bg, box = "transparent"),
with.bg = FALSE,
par.strip.text = list(font = 2))
|
win.fontfamily |
on Windows systems, sets the font by name. |
with.bg |
if |
box |
color for panel boxes, strip outlines, and axis ticks. |
... |
further arguments passed to |
x |
a |
type |
plot type, relevant for |
ylab, xlab |
axis labels, blank by default. |
par.settings |
style settings, defaulting to |
par.strip.text |
see |
You can just use par.settings = theEconomist.theme()
, which
gives you some colors and styles, but it does not do the
grid lines or axis settings.
Felix Andrews felix@nfrac.org
http://www.economist.com/displayStory.cfm?story_id=15065782
http://www.economist.com/displayStory.cfm?story_id=14941181
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | xyplot(window(sunspot.year, start = 1900),
main = "Sunspot cycles", sub = "Number per year",
par.settings = theEconomist.theme(box = "transparent"),
lattice.options = theEconomist.opts())
asTheEconomist(xyplot(window(sunspot.year, start = 1900),
main = "Sunspot cycles", sub = "Number per year"))
trellis.last.object() +
layer_(panel.xblocks(x, x >= 1980, col = "#6CCFF6", alpha = .5)) +
layer(panel.text(1988, 180, "Forecast", font = 3, pos = 2))
## set as defaults -- remember to set back when finished.
opar <- trellis.par.get()
trellis.par.set(theEconomist.theme(box = "transparent"))
oopt <- lattice.options(theEconomist.opts())
barchart(Titanic[,,,"No"], main = "Titanic deaths", layout = 1:2,
sub = "by sex and class", auto.key = list(columns = 2),
scales = list(y = list(alternating = 2)))
asTheEconomist(
dotplot(VADeaths, main = "Death Rates in Virginia (1940)",
auto.key = list(corner = c(.9,0.1))),
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))
## reset
trellis.par.set(opar)
lattice.options(oopt)
|
Loading required package: lattice
Loading required package: RColorBrewer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.