Hello,

In labcurve, use "keys=c(19,5)". It is said in examples provided in the
help page.

You should also modify the following lines:
> lines(timeseries,dataseries1,col="red",type="l")
> lines(timeseries,dataseries2,col="blue",type="l")

Regards,
Pascal


2013/8/23 Igor Ribeiro <igor...@gmail.com>

> Dear all,
> I have a plot with two lines and I'm using labcurbe (package Hmisc) to show
> the legend.
> Everything works well, except that the line displayed in legend box should
> have same style (plotting character) as the line in the plot. This is
> achieved by pch parameter and looks like that it's only supported via
> putKey function (according to the documention here:
> http://www.inside-r.org/packages/cran/Hmisc/docs/bezier).
>
> However, I've been unsucessful to correctly use this function (putKey).
> Could someone help me fix the code below?
>
> library(Hmisc)
>
> rm(list=ls(all=TRUE))
> timeseries<-c(1950,2000,2050,2100)
> dataseries<-seq(1:4)
> dataseries1<-c(1,2,3,4)
> dataseries2<-c(1.5,2.5,3.5,4)
> plot(timeseries,dataseries,type="n")
> lines(timeseries,dataseries1,col="red",type="o",pch=19)
> lines(timeseries,dataseries2,col="blue",type="o",pch=5)
> curves<-list()
> curves[[1]]<-list(x=timeseries,y=dataseries1)
> curves[[2]]<-list(x=timeseries,y=dataseries2)
> dataSeriesLabels<-c("this legend should have pch=19","this legend should
> have pch=5")
>
> # PROBLEM BELOW
> #putKey(z=curves,labels=dataSeriesLabels,pch=19)
>
> labcurve(curves, dataSeriesLabels, type=rep("s",2), lty=rep("solid",2),
> lwd=1, col=c("red","blue"), keys="lines", cex=1, adj="auto",
> keyloc=c("auto"), transparent=FALSE)
>
> Thank you,
> --
> Igor.
> igor...@gmail.com
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to