[R-sig-Geo] plot.polylist polygon plot order

Roger Bivand Roger.Bivand at nhh.no
Wed Aug 22 11:34:46 CEST 2007


On Wed, 22 Aug 2007, Didier Leibovici wrote:

> Thanks for this, I've seen also the function plot.Map with the parameter 
> ol=NA but it is also "deprecated" (I didn't know plot.polylist was)
>
> With plot.Map I had the message
>> plot(Z300PolMap,ol=NA,auxvar=Z300.PTA3[[1]]$v[1,],color="blue",nclass=300)
> Warning message:
> 'plot.Map' is deprecated.
> Use 'plot.Spatial' instead.
> See help("Deprecated") and help("maptools-deprecated").
>
> but I couldn't find plot.Spatial

See details in package sp, the actual function is

sp:::plot.SpatialPolygons

or perhaps simply use spplot on the SpatialPolygonsDataFrame object?

Making everything depend on an ad-hoc representation of a shapefile when 
the data may actually be more varied (read by readOGR in rgdal) is very 
limiting.

Roger

>
> thanks again
> Didier
>
> Roger Bivand wrote:
>>  On Tue, 21 Aug 2007, Didier Leibovici wrote:
>> 
>> >  Hi there,
>> > 
>> >  With plot.polylist is there a way of not drawing the "border" or 
>> >  controlling the width of the border in order to diminish the vision of 
>> >  horror when using a smaller colour range  than the number of polygons 
>> >  and when you have quite a lot of polygons in your "shape".
>>
>>  "Horror" is in the eye of the beholder, and can be controlled easily by
>>  setting the device size to something other than the default.
>>
>>  border="transparent"
>>
>>  lwd= is not passed through in this "deprecated" function - it is for the
>>  SpatialPolygon class, for which unionSpatialPolygons() is also available.
>>
>>  Hope this helps,
>>
>>  Roger
>> 
>> >  I am thinking as well of possible merging or fusion of neighbour 
>> >  polygons having the same color which would give an half way solution ... 
>> >  but I don't know the "union" polygon merging polygons function. (which 
>> >  should be standard I suppose ...)
>> > 
>> >  thanks
>> > 
>> >  Didier
>> > 
>> > 
>> > 
>> > 
>> >  Sutherland, Robert D (DFG) wrote:
>> > >   Hi Jeff,
>> > > 
>> > >   This is what I did.
>> > > 
>> > >   HistBreaks<-quantile(datafileDf$nhunters,probs=c(0.1,0.2,
>> > >   0.4,0.6,0.8,0.9,1.0),na.rm=TRUE)
>> > >   np<-findInterval(datafileDf$nhunters, histBreaks, all.inside=TRUE)
>> > >   colorsToUse<-colorSchemeV5
>> > >   plot.polylist(datafilePolys, col=colorsToUse[np],  forcefill=FALSE)
>> > >   plot.polylist(datafilePolys,  density = c(-1,20,20,-1,-1,-1,-1)[np],
>> > >   angle=c(0,0,90,0,0,0,0)[np], forcefill=FALSE,add=TRUE)
>> > > 
>> > >   the first plot.polylist plots the outline of the polygon, the second
>> > >   call "colors" the polygon.
>> > > 
>> > >   I hope this helps.
>> > > 
>> > >   Bob
>> > > 
>> > >   -----Original Message-----
>> > >   From: r-sig-geo-bounces at stat.math.ethz.ch
>> > >   [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Jeff 
>> > >   Jorgensen
>> > >   Sent: Wednesday, July 18, 2007 9:30 AM
>> > >   To: r-sig-geo at stat.math.ethz.ch
>> > >   Subject: [R-sig-Geo] plot.polylist polygon plot order
>> > > 
>> > >   Hello,
>> > > 
>> > >   I've imported a shapefile of polygons (R v2.5.1 winxp, maptools 
>> > >   v0.6-13)
>> > > 
>> > >   and I'm trying to assign colors to polygons in plot.polylist().  Is 
>> > >   there
>> > >   a way to force the order in which polygons are plotted get the 
>> > >   correct
>> > >   color associations to the corresponding polygons?
>> > > 
>> > >   Best regards,
>> > > 
>> > >   Jeff
>> > > 
>> > > 
>> > > 
>> > 
>> >  This message has been checked for viruses but the contents of an 
>> >  attachment
>> >  may still contain software viruses, which could damage your computer 
>> >  system:
>> >  you are advised to perform your own checks. Email communications with 
>> >  the
>> >  University of Nottingham may be monitored as permitted by UK 
>> >  legislation.
>> > 
>> >
>> 
>
>
> This message has been checked for viruses but the contents of an attachment
> may still contain software viruses, which could damage your computer system:
> you are advised to perform your own checks. Email communications with the
> University of Nottingham may be monitored as permitted by UK legislation.
>
>

-- 
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