In [15]:
%matplotlib

import numpy as np
from matplotlib.patches import Circle, Wedge, Polygon
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

start = 0, 0

circles = []
circles.append((1,7,2))
circles.append((9,9,2))
circles.append((6,2,2))
circles.append((10,0,2))

circles.append((13,7,1))

pathx = []
pathy = []

def add_path(x, y):
    pathx.append(x)
    pathy.append(y)
    
    
add_path(*start)
for x, y, r in circles:
    add_path(x, y)

patches = []
for x, y, r in circles:
    circle = Circle((x, y), r, fill = False, ls='-', lw=2)
    patches.append(circle)


p = PatchCollection(patches, alpha=0.4)
ax.add_collection(p)

ax.set_xlim(-2, 14)
ax.set_ylim(-2, 14)
ax.set_aspect(1.0)

plt.plot(pathx, pathy)

plt.show()


Using matplotlib backend: TkAgg

In [ ]:


In [ ]: