[R] Automatically placing a legend in an area with the most white space...

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Jun 30 05:46:16 CEST 2009


Also check out the Hmisc package's largest.empty and putKeyEmpty and 
related functions.

Frank


Jason Rupert wrote:
> That fixed it.  I thought I was getting the hang of R, but I guess I still have a long way to go.  
> 
> One last question regarding the dynamic placement of the legend in the location on a plot with the largest empty space, is there a way to assure that the legend doesn't go off the plot or is partially clipped by the boarder of the plot? 
> 
> I posted the example to nabble:
> http://n2.nabble.com/With-%22emptyspace%22-is-there-anyway-to-guarantee-legend-won%27t-be-off-the-plot--td3178773.html
> 
> Thanks for any feedback. 
> 
> Jason 
> 
> 
> 
> 
> --- On Sun, 6/28/09, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> 
>> From: Stavros Macrakis <macrakis at alum.mit.edu>
>> Subject: Re: [R] Automatically placing a legend in an area with the most white  space...
>> To: "Jason Rupert" <jasonkrupert at yahoo.com>
>> Cc: "Jim Lemon" <jim at bitwrit.com.au>, R-help at r-project.org
>> Date: Sunday, June 28, 2009, 3:16 PM
>>
>> install.packages('plotrix')
>>
>> On Sun, Jun 28, 2009 at 3:51 PM,
>> Jason Rupert <jasonkrupert at yahoo.com>
>> wrote:
>>
>> ...
>>
>> Error in legend(emptyspace(rep(x_vals_1, 3), c(y1_vals,
>> y2_vals, y3_vals)),  :
>>
>>   could not find function "emptyspace"
>>
>>
>>
>> I've searched via RSeek, but I have not been able to
>> find anything on this function.
>>
>>
>>
>> Is emptyspace part of a package that I need to install?
>>
>>
>>
-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list