[R] Plotting and Decluttering Text

Al Piszcz apiszcz at solarrain.com
Sun Dec 19 18:08:18 CET 2004


Goal: adjust overlapping 'text' items in plot so they are legible

I have located 'space' as one possible technique for decluttering
text positions on a plot. I would rather not jitter the plot point, just
the text nearby.

Are there other techniques or functions available that declutters a plot 
using 'text'?

Perhaps an arrow or a line to the plot mark could be used to
lead to the text item.

The following will demonstrate my concern. If you do not see overlap
use a larger value for plot density. The plot I am attempting with the
real data has a density of 64 providing space adjacent to the point.
In the real data there are few clusters that have tighter spacing
than produced in the example below. A plotdensity value of 150 or so
will give a better visualization of the issue.

Thanks.

# EXAMPLE VIEW
plotdensity<-150
x1<-rnorm(plotdensity)
y1<-rnorm(plotdensity)
plot(x1,y1)
textLabels <- as.character(1:plotdensity)
text(x1,y1,textLabels,pos=1)



==
I have also reviewed sunflowerplot.




More information about the R-help mailing list