[R-sig-Geo] shifting points in plot window

Edzer Pebesma edzer.pebesma at uni-muenster.de
Mon Nov 24 15:58:34 CET 2014


I believe plotting routines in raster were built from (or inspired by)
those in package fields. The issue arises when the plotting area is
split in two parts, one for the map and one for the legend, and the need
to know the aspect ratio of the first when adding to the plot -- the
legend width is fixed, and that might mess up aspect of the map region
when resizing.

image methods from sp do not have this problem, but also do not show you
the legend. sp::spplot uses grid, so doesn't let you add to plots
incrementally.



On 11/24/2014 02:56 PM, Michael Krabbe Borregaard wrote:
> Thanks,
> This was very helpful. I have a package that depends on raster, and have included a note on this in the documentation.
> 
> 
> From: Michael Sumner:
> 
> This is a known problem with no known fix. I've been trying to isolate it but without success.
> 
> If anyone can see how to fix it we can help get it into raster - I believe that it is somewhere in the plot method/s for the raster package. It occurs for any vector data overlay, and for either useRaster (for image()) set TRUE or FALSE.
> 
> Cheers, Mike
> 
> On Mon, 17 Nov 2014 21:46 mkborregaard <mkborregaard at snm.ku.dk<mailto:mkborregaard at snm.ku.dk>> wrote:
> When I plot a raster image (package raster) and then plot points on top (type
> SpatialPoints, package sp) everything aligns well. But if then resize the
> window, the alignment disappears, and the points move around. Can I avoid
> this behavior? The points and the raster are both defined as lat/long data.
> proj4string is "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
> for both.
> 
> I am sorry for posting a very simple question that I should be able to find
> the resolution of, but I have not been able to find this.
> 
> 
> 
> 
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/shifting-points-in-plot-window-tp7587439.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma,  Co-Editor-in-Chief Computers & Geosciences
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20141124/f7398d08/attachment.bin>


More information about the R-sig-Geo mailing list