I need to plot a list of disconnected circles which I have created for other purposes in shapely.
I was trying to do exactly as the example in http://toblerity.org/shapely/manual.html#cascading-unions shows (see code) but that works only if the circles overlap and the overall thing is connected (which is not in my case). As you can see by replacing the line
polygons = [Point(i, 0).buffer(0.7) for i in range(5)]
with
polygons = [Point(i, 0).buffer(0.7) for i in (0,4)]
that breaks with and AssertionError
for the thing not being a Polygon by descartes (or by matplotlib failing assert vertices.ndim == 2
if one comments out the descartes assertion as a test)
Looking at the docs for matplotlib.path.Path it seems possible to use MOVETO to achieve this goal, but shapely does not seem to support it. Is this correct? What workarounds do I have?
The following code works:
the output: