paleolimbot / geos

Open Source Geometry Engine ('GEOS') R API
https://paleolimbot.github.io/geos/
Other
61 stars 8 forks source link

multi-plot issue #63

Closed mdsumner closed 2 years ago

mdsumner commented 2 years ago

I see par(mfrow) not respected when using the constrained triangulation (first thing I tried of course ...)

  library(geos)
line <- as_geos_geometry("LINESTRING (30 10, 10 30, 40 40)")
buf <- geos_buffer(line, distance = 4)
tr <- geos_constrained_delaunay_triangles(buf)

## here the plot windows get bumped so we get a new cycle for the second plot
par(mfrow = c(2, 1))
plot(buf)
plot(tr) ## run this we've lost the first row-plot

par(mfrow = c(2, 1))
plot(buf)
plot(buf) ## ok this way

seems to be an issue with GEOMETRYCOLLECTION, I see same for geos_voronoi_polygons but not for edges.

(possibly unwelcome while you're in the thick of it ... :) )

paleolimbot commented 2 years ago

Very welcome!

Looks like I'm missing an add = TRUE here: https://github.com/paleolimbot/wk/blob/master/R/plot.R#L104