Hi everyone. I have a quick question regarding the look of my legend in my plot. As you can see in the next figure, I have 3 series. http://r.789695.n4.nabble.com/file/n3067466/legend.png However, I find rather difficult to differentiate the series 1 and 3 according to their line type (lty). I would like to know if it was possible to make the line type in the legend to appear more clearly. For example, to give more horizontal space each side of the symbols "square" to have a better idea of the line type. With regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Question-regarding-legend-look-tp3067466p3067466.html Sent from the R help mailing list archive at Nabble.com.
On Dec 1, 2010, at 10:13 AM, Filoche wrote:> > Hi everyone. > > I have a quick question regarding the look of my legend in my plot. > As you > can see in the next figure, I have 3 series. > > http://r.789695.n4.nabble.com/file/n3067466/legend.png > > > However, I find rather difficult to differentiate the series 1 and 3 > according to their line type (lty). I would like to know if it was > possible > to make the line type in the legend to appear more clearly. For > example, to > give more horizontal space each side of the symbols "square" to have a > better idea of the line type.The specifics will depend on what plotting function produced the graph from which you have given us a bitmap snapshot BUT NOT SHOWN US CODE OR SAMPLE DATA. In xyplot you would be working with the key/lines/size elements (after showing us which of the several legend options were specified): ?xyplot In base graphics I do not see a "handle" on the line length but (perhaps) you could emphasize the line compenent by increasing cex which affects all components and at the same time decrease the point size. E.g.: legend( ..., cex=1.5, pt.cex=0.8, cex=1.5, pt.cex=0.8, ...) As always____>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.__ ___________________________________ David Winsemius, MD West Hartford, CT
On Dec 1, 2010, at 11:51 AM, David Winsemius wrote:> > On Dec 1, 2010, at 10:13 AM, Filoche wrote: > >> >> Hi everyone. >> >> I have a quick question regarding the look of my legend in my plot. >> As you >> can see in the next figure, I have 3 series. >> >> http://r.789695.n4.nabble.com/file/n3067466/legend.png >> >> >> However, I find rather difficult to differentiate the series 1 and 3 >> according to their line type (lty). I would like to know if it was >> possible >> to make the line type in the legend to appear more clearly. For >> example, to >> give more horizontal space each side of the symbols "square" to >> have a >> better idea of the line type. >snipped> t (perhaps) you could emphasize the line compenent by increasing cex > which affects all components and at the same time decrease the point > size. E.g.: > > legend( ..., cex=1.5, pt.cex=0.8, cex=1.5, pt.cex=0.8, ...)At one point that said: legend( ..., merge=TRUE, cex=1.5, pt.cex=0.8, ...)> > As always____> >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > __ ___________________________________ >David Winsemius, MD West Hartford, CT
On 01/12/2010 10:13 AM, Filoche wrote:> Hi everyone. > > I have a quick question regarding the look of my legend in my plot. As you > can see in the next figure, I have 3 series. > > http://r.789695.n4.nabble.com/file/n3067466/legend.png > > > However, I find rather difficult to differentiate the series 1 and 3 > according to their line type (lty). I would like to know if it was possible > to make the line type in the legend to appear more clearly. For example, to > give more horizontal space each side of the symbols "square" to have a > better idea of the line type.There is no parameter to the legend function to control this, but it is pure R code, so you could write your own by modifying the legend() function. If you take a look at legend, you'll see that it draws lines of length 2 (in some units) when do.lines is TRUE. Change that to a bigger number, and you'll get longer lines. You'll also need to fiddle with the size of the box, or the legend won't fit. (I think xbox is the variable holding its width.) Duncan Murdoch