[R] dotplot legend

Michael Dewey info at aghmed.fsnet.co.uk
Wed Dec 17 14:36:35 CET 2014



On 17/12/2014 12:24, rl at openmailbox.org wrote:
> Subscribers,
>
> For this example:
>
> library(lattice)
> testmatrix<-matrix(c(1,2,3,4,3,6,12,24),nrow=4,ncol=2)
> testylabels<-c('w1','x1','y1','z1')
> dotplot(testmatrix, scales=list(y=list(labels=testylabels), xlab=NULL))
> legend('bottomright', 'legend', col=c('blue', 'pink'))
> Error in strwidth(legend, units = "user", cex = cex) :
>    plot.new has not been called yet

lattice uses grid graphics, not base graphics. I suspect you have to 
come to grips with the key parameter in dotplot.

>
> The help for 'plot.new' is not understood; the graph has been called in
> the previous commands?
>
> ______________________________________________
> 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.
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2015.0.5577 / Virus Database: 4253/8751 - Release Date: 12/17/14
>
>

-- 
Michael
http://www.dewey.myzen.co.uk



More information about the R-help mailing list