% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/slopegraph.R
\name{slopegraph}
\alias{slopegraph}
\title{slopegraph}
\usage{
slopegraph(
  x,
  y = NA,
  type = "b",
  names.arg = NA,
  xlab = NA,
  ylab = NA,
  colorize = F,
  pal = c("firebrick", "steelblue"),
  shim = 0.5,
  cex.text = 0.8,
  ...
)
}
\arguments{
\item{x:}{numeric vector of values to plot on the left}

\item{y:}{numeric vector of values to plot on the right}

\item{type:}{'b' displays both points and lines; 'l' displays lines only.
't' replaces points with numeric values, as per Tufte.}

\item{names.arg:}{optional names for labeling the x-axis}

\item{xlab:}{label for x-axis, as in generic \code{plot()}. Defaults to 'Groups'.}

\item{ylab:}{label for y-axis, as in generic \code{plot()}. Defaults to \code{NA}.}

\item{colorize:}{use line colours to emphasize slope}

\item{pal:}{vector of two colours for annotating slopes down and up, respectively.}

\item{shim:}{width of horizontal padding to left and right of plot}

\item{cex.text:}{character expansion for text}

\item{...:}{additional arguments to pass to \code{plot()}}
}
\description{
\code{slopegraph} displays paired sample data as two sets of points connected 
by line segments as a visualization of overall trends.  See also @leeper/slopegraph
at GitHub.
}
\examples{
# CO2 emissions data
co2.emissions

# with default settings
slopegraph(co2.emissions)

# annotate slopes with colour
slopegraph(co2.emissions, names.arg=c(2000, 2010), 
ylab=expression(text=paste('CO'[2], ' emissions (metric tons) per capita')), 
type='b', cex.lab=1.2, colorize=T)

# more in style of Edward Tufte
slopegraph(co2.emissions, names.arg=c(2000, 2010), type='t')
title(expression(text=paste('CO'[2], ' emissions (metric tons) per capita')), 
family='Palatino')

}
