Re: [R] [R-sig-Geo] plot methods in sp

From: Edzer J. Pebesma <>
Date: Mon 01 Jan 2007 - 15:47:24 GMT

Patrick, I can see this is confusing.

Besides methods(plot), try after library(sp) a


to get an overview of the S4-style plot methods; methods(plot) only shows the S3-style plot methods. Then,


gives methods available for this class, among which plot, and the html listing of plot methods has entries like


that points to the same help page (which is rather brief).

getMethod("plot", c("SpatialPolygons", "missing"))

shows you the arguments this method takes, and shows that it actually calls plot.SpatialPolygons. This method is not exported from sp, so to view it you need to access it as


the other sp functions it calls can also be accessed by preceding them with sp:::

I agree that more elaborate documentation along with examples would be useful.

Hope this helps,


Patrick Giraudoux wrote:

> Dear listers,
> I am working since a while with the sp package and still wonder how the
> plot methods are managed with sp spatial objects. For instance,
> SpatialPolygonsDataFrame objects have obviously a plot method. However
> it cannot be found in the list provided by methods(plot) . Furthermore
> ?plot.SpatialPolygonsDataFrame, nor ?plot.SpatialPolygons, etc.. provide
> a help, though the lattice function spplot is adequately documented.
> On the other hand, plot(myobject, border="grey"), with myobject a
> SpatialPolygonsDataframe is well interpreted and recalls the syntax of
> plot.polylist of matools (though myobject is far from being a polylist...).
> Can anybody (especially the package's authors...) comment on this? Where
> a help with the list of the plot function arguments can be found?
> Thanks for any hint,
> Patrick
> _______________________________________________
> R-sig-Geo mailing list
______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Tue Jan 02 03:20:00 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 01 Jan 2007 - 16:30:27 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.