[R] How to add legend to a dotplot

Jim Lemon drjimlemon at gmail.com
Wed Jun 3 06:03:15 CEST 2015


Hi Hanna,
That is because "dotplot" is a lattice graphics function and "legend"
is a base graphics function. There are two things you can do to fix
this. One is to use the "dotchart" function in base graphics. The
other is to use simpleKey in the latticeExtra package for the legend.

Jim


On Wed, Jun 3, 2015 at 1:06 PM, li li <hannah.hlx at gmail.com> wrote:
> Hi all,
>   I wanted to add the legend to a dotplot using legend funciton. If
> does not seem to be working? Anyone have any suggestions?
>   Thanks!
>   Hanna
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list