[R-sig-Geo] layout and plot.stars

Patrick Giraudoux p@tr|ck@g|r@udoux @end|ng |rom un|v-|comte@|r
Tue Mar 15 08:12:49 CET 2022


Hi,

I have a trouble with the combination of layout and plot.stars. e.g.

nf <- layout(matrix(c(1,2),2,1,byrow = TRUE), c(3,3), c(3,1), TRUE)
layout.show(nf)

plot(st_geometry(mydept),col="grey",border="grey90")
plot(st_rasterize(ztot),col=mypal(12),main="",breaks="equal",add=TRUE)

plot(mypoly,col=mypal(12),border=mypal(12))

I expect that the first two plots display in region #1, the second added 
to the first, and the third plot in region #2. However, this is not what 
happens: actually, the third plot displays in region 1 erasing the 
others. I understand that plot.stars when not "added" does not respect 
the layout definition (and displays its own regions), and that my 
problem comes from the way plot.stars deals with that.

Has anyone an idea about a workaround ?



More information about the R-sig-Geo mailing list