SCM Repository

[directlabels] View of /tex/useR-2011/directlabels.Rnw
ViewVC logotype

View of /tex/useR-2011/directlabels.Rnw

Parent Directory Parent Directory | Revision Log Revision Log

Revision 414 - (download) (annotate)
Tue Feb 22 10:57:13 2011 UTC (9 years, 4 months ago) by tdhock
File size: 3120 byte(s)
team purpose annotations
\usepackage{amsfonts, amsmath, hanging, hyperref, natbib, parskip, times}

\newcommand{\pkg}[1]{{\normalfont\fontseries{b}\selectfont #1}} 
\renewcommand{\title}[1]{\begin{center}{\bf \LARGE #1}\end{center}}



\title{Adding direct labels to plots}

  {\bf Toby Dylan Hocking$^{1,2,^\star}$}

  1. INRIA Sierra team for machine learning research,
  23 avenue d'Italie, Paris, France\\[-2pt]
  2. Institut Curie/INSERM U900/Mines ParisTech cancer bioinformatics group,
  26 rue d'Ulm, Paris, France\\[-2pt]
  $^\star$Contact author:

\keywords Visualization, graphics, legends, direct labels

\vskip 0.8cm

High-level plotting systems such as \pkg{lattice} and \pkg{ggplot2}
provide automatic legends for decoding color labels in \proglang{R}
plots \citep{lattice,ggplot2}. However, with many colors, legends
become difficult to read, and direct labels are a more suitable
decoding method:


p <- xyplot(jitter(cty)~jitter(hwy),mpg,groups=class,
            main="City and highway fuel efficiency depends on car class")
##p2 <- update(p,main="City and highway fuel efficiency depends on car class")

Direct labels are inherently more intuitive to decode than legends,
since they are placed near the related data. However, direct labels
are not widely used because they are often much more difficult to
implement than legends, and their implementation varies between
plotting systems.

The \pkg{directlabels} package solves these problems by providing a
simple, unified interface for direct labeling in \proglang{R}. Given a
\pkg{lattice} or \pkg{ggplot2} plot saved in the variable \texttt{p},
direct labels can be added by calling \texttt{direct.label(p,f)} where
\texttt{f} is a Positioning Method that describes where labels
should be placed as a function of the data. The power of this system
lies in the fact that you can write your own Positioning Methods,
and that any Positioning Method can be used with any plot. So once
you have a library of Positioning Methods, direct labeling becomes
trivial and so can more easily used as a visualization technique in
everyday statistical practice.

% The
% \pkg{directlabels} package comes with several Positioning Methods for
% different plot types, and a system of intelligent defaults so that
% often you don't even need to specify the Positioning Method.


ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge