[R] line jump in plot legend title

Dutrieux, Loïc loic.dutrieux at wur.nl
Tue Jul 19 17:18:14 CEST 2011


I also noticed, after sending the code that the modification does only work when the legend is positioned at the bottom of the figure region , and the function crashes when no title is provided.
The modification I applied to the code was intended to be more the solving of a particular problem than a real contribution to the function. Unfortunately my programing skills are quite limited to really contribute to the project.
However, if one of you manage to make the change work in all case, I believe including it in a next version of R is relevant.

Regards,

Loïc

-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: dinsdag 19 juli 2011 16:56
To: Duncan Murdoch
Cc: Dutrieux, Loïc; r-help at r-project.org
Subject: Re: [R] line jump in plot legend title


On Jul 19, 2011, at 10:38 AM, Duncan Murdoch wrote:

> On 11-07-19 8:16 AM, loic wrote:
>> As suggested by David, I applied some modifications to the code of 
>> the legend function so that the legend box size adapts to the number 
>> of line jumps in the legend title.
>>
>> Attached the modified code of the function.
>
> No code was attached.

But there was code at the link. It does behave as hoped with defaults unchanged, but when cex is altered, the size of the box does not seem to change appropriately.

>
> In case you didn't, could you make sure that your modification is to 
> the version of the code that's in the svn repository?  Then it will be 
> straightforward to import your change into R.
>
> That version is online at
>
> https://svn.r-project.org/R/trunk/src/library/graphics/R/legend.R
>
> if your changes only affect the legend() function.
>
> Duncan Murdoch
>
>>
>> Thanks to David
>>
>> Regards,
>>
>> Loïc
>> Wageningen University
>>
>> http://r.789695.n4.nabble.com/file/n3677996/legend.r legend.r
>>
>> --
>> View this message in context: 
>> http://r.789695.n4.nabble.com/line-jump-in-plot-legend-title-tp367615
>> 7p3677996.html Sent from the R help mailing list archive at 
>> Nabble.com.
>>
>> ______________________________________________
>> R-help at 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.
>
> ______________________________________________
> R-help at 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list