[R] Legend best position

Jim Lemon jim at bitwrit.com.au
Thu Apr 30 11:40:07 CEST 2009


Christian Bustamante wrote:
>> Hi all,
>>
>> I'm doing a lot of plots and all of them should have a legend. The
>> problem is that this legend not always have to be in the same place,
>> because some plots can override the legend box. I'm wondering if there
>> exist a command that "optimally" allocate the legend position, I'm
>> refer to a MATLAB's command'slegend and it's option "Best". Exist?

It's not perfect, but the emptyspace function in the plotrix package 
does a reasonable job if the plot isn't really full.

Jim




More information about the R-help mailing list