Skip to content

Legend best position

3 messages · Christian Bustamante, Frank E Harrell Jr, Jim Lemon

#
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?
What is?

Bests regards
#
This may not be what you are wanting but see the labcurve function in 
the Hmisc package, which helps you position things in the 'most empty' 
portions of the graphics region.

Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University
Christian Bustamante wrote:
#
Christian Bustamante wrote:
It's not perfect, but the emptyspace function in the plotrix package 
does a reasonable job if the plot isn't really full.

Jim