SCM

SCM Repository

[latticeextra] View of /www/man/theEconomist.theme.html
ViewVC logotype

View of /www/man/theEconomist.theme.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 143 - (download) (as text) (annotate)
Tue May 25 06:54:57 2010 UTC (9 years ago) by felix
File size: 4939 byte(s)
get rid of ".featured_example", just use example number
<html><head><title>R: Generate plots with style like The Economist.</title>


</head><body>

<table width="100%" summary="page for theEconomist.theme {latticeExtra}"><tr><td>theEconomist.theme {latticeExtra}</td><td align="right">R Documentation</td></tr></table>

<h2>Generate plots with style like The Economist.</h2>


<h3>Description</h3>

<p>
Uses colors, drawing styles, axis settings, etc, to produce plots
inspired by those in The Economist
magazine. (<a href="http://www.economist.com/">http://www.economist.com/</a>).
</p>


<h3>Usage</h3>

<pre>
asTheEconomist(x, type = "l",
    vertical = FALSE, zeroline = "red",
    par.settings =
      theEconomist.theme(with.bg = with.bg, box = "transparent"),
    with.bg = FALSE,
    titleSpec = list(x = grid::unit(5, "mm"), just = "left"),
    ylab = expression(NULL), xlab = expression(NULL),
    scales = list(axs = "i", x = list(tck = 0, alternating = 1),
                             y = list(tck = 0, alternating = 2)),
    par.strip.text = list(font = 2),
    between = list(x = 1, y = 1))

theEconomist.theme(win.fontfamily = NULL,
    with.bg = FALSE, box = "black", ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>

a <code>trellis</code> object, i.e. the result of a high-level plot
function in the Lattice framework.
</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>

plot type, relevant for <code>xyplot</code>s, see <code>panel.xyplot</code>.
</td></tr>
<tr valign="top"><td><code>vertical</code></td>
<td>

to draw vertical grid lines rather than the default horizontal.
</td></tr>
<tr valign="top"><td><code>zeroline</code></td>
<td>

color for a grid line to draw at zero on the x axis (or y axis if
<code>vertical = TRUE</code>. Set to <code>NA</code> to omit.
</td></tr>
<tr valign="top"><td><code>par.settings</code></td>
<td>

style settings, defaulting to <code>theEconomist.theme</code>.
</td></tr>
<tr valign="top"><td><code>with.bg</code></td>
<td>

if <code>TRUE</code>, uses a light blue background and a few other
corresponding changes; otherwise white.
</td></tr>
<tr valign="top"><td><code>titleSpec</code></td>
<td>

position and justification settings to be used in the <code>main</code>
and <code>sub</code> arguments to <code>xyplot</code>.
</td></tr>
<tr valign="top"><td><code>ylab, xlab</code></td>
<td>

axis labels, blank by default.
</td></tr>
<tr valign="top"><td><code>scales, par.strip.text, between</code></td>
<td>

see <code>xyplot</code>.
</td></tr>
<tr valign="top"><td><code>win.fontfamily</code></td>
<td>

on Windows systems, sets the font by name.
</td></tr>
<tr valign="top"><td><code>box</code></td>
<td>

color for panel boxes, strip outlines, and axis ticks.
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>

further arguments passed to <code>simpleTheme</code>
and used to modify the theme.
</td></tr>
</table>


<h3>Details</h3>

<p>
You can just use <code>par.settings = theEconomist.theme()</code>, which
gives you the colors and styles, but it does not do the
grid lines, axis settings, or title settings.
</p>


<h3>Author(s)</h3>

<p>
Felix Andrews <a href="mailto:felix@nfrac.org">felix@nfrac.org</a>
</p>


<h3>References</h3>

<p>
<a href="http://www.economist.com/displayStory.cfm?story_id=15065782">http://www.economist.com/displayStory.cfm?story_id=15065782</a>
</p>
<p>
<a href="http://www.economist.com/displayStory.cfm?story_id=14941181">http://www.economist.com/displayStory.cfm?story_id=14941181</a>
</p>


<h3>See Also</h3>

<p>
<code><a href="#custom.theme">custom.theme</a></code>
</p>


<h3>Examples</h3>

<pre>
asTheEconomist(xyplot(window(sunspot.year, start = 1900),
  main = "Sunspot cycles", sub = "Number per year",
  scales = list(y = list(relation = "same", axs = "i"))))

trellis.last.object() +
  layer_(panel.xblocks(x, x &gt;= 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 &lt;- density(x), i &lt;- which.max(d$y),
  ltext(d$x[i], d$y[i], paste("Group", group.number), pos = 3))
</pre>

<div align="center">[Package <em>latticeExtra</em> version 0.6-12 <a href="00Index.html">Index</a>]</div>
</body></html>

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge