Skip to content

arrangement of crowded labels

6 messages · Richard Cotton, Thomas Zumbrunn, Greg Snow +1 more

#
Dear R users

I'm looking for algorithms that assist in spreading out crowded labels, e.g. 
labels of points in a scatter plot, in order to obtain a nicer visual 
appearance and better legibility. 

I'm probably just stuck because I didn't find the right key words for a 
successful search on the R websites or in the mailing list archives.

Any hints are appreciated.

Thomas Zumbrunn
University of Basel
#
e.g.
Try thigmophobe.labels in the plotrix package.

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}
#
Look at the spread.labs and the dynIdentify and TkIdentify functions in the TeachingDemos package.
#

        
On Wednesday 20 May 2009, Richard.Cotton at hsl.gov.uk wrote:

        
On Wednesday 20 May 2009, Greg Snow wrote:
Thanks for your answers. This was almost what I was looking for, except that I 
would need something for a 2-dimensional context (my question was not specific 
enough).

Best wishes
/thomas
#
The dynIdentify and TkIdentify functions work in 2 dimensions (and I think the thigmophope.labels does as well).  The algorithm in spread.labs could be adapted to 2 dimensions (the example shows a semi-2 dimensional approach) if you can define what you want to happen (can labels overplot the points?, how far from the points can they move?, etc.), other than toy examples, I think the interactive approach in (dyn/Tk)Identify is probably better than trying to work out all the rules to give to a fully automated function (unless you need something fully automatic).

Hope this helps,
#
Thomas Zumbrunn wrote:
Hi Thomas,
The thigmophobe.labels function just works out how to place each label 
away from the nearest point to the point that is being labeled. The 
pointLabel function in the maptools package and the spread.labs function 
in Teaching Demos use more sophisticated algorithms to do this, and may 
work in situations where thigmophobe.labels wouldn't separate all the 
labels.

Jim