[R-sig-Geo] rotate label in plot based on polygon shape

Roger Bivand Roger.Bivand at nhh.no
Fri Jun 11 01:51:05 CEST 2010


On Thu, 10 Jun 2010, christiaan pauw wrote:

> Hi everybody
>
> Is it possible, when plotting a SPDF to rotate the label in a polygon based
> on the shape of the polygon. I want the greatest possible length in which to
> print the label and don't mind  reading upside down as long as the label is
> readable. I am printing a map consisting of tens of thousands of labeled
> polygons ( of various shape s but mainly rectangles). If the rectangle is
> orientated with its long side horizontally (like so | LABEL |), the labels
> are readable but if the short side is on the horisontal level then the label
> runs into and over the rectangle and all the lables end up in an unreadable
> tangle. In that case I would prefer to have something like this
> _
> |L|
> |A|
> |B|
> |E|
> |L|

The par(srt=) argument can be set to rotate all labels in a text() command 
- it only takes a single value in each call to text(), but not the letters 
in a label. Label placement is a hard problem to solve automatically. See 
?pointLabel in maptools for some unrotated ways of avoiding point labels 
overlapping, but I don't think that it will help much. Can you abbreviate 
the labels - see ?abbreviate?

Roger

>
> Does anyone know if it is possible to specify the rotation of labels in some
> way?
>
> Thanks is advance
>
> Christiaan
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list