1import matplotlib.pyplot as plt
2
3circle1 = plt.Circle((0, 0), 0.2, color='r')
4circle2 = plt.Circle((0.5, 0.5), 0.2, color='blue')
5circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False)
6
7fig, ax = plt.subplots() # note we must use plt.subplots, not plt.subplot
8# (or if you have an existing figure)
9# fig = plt.gcf()
10# ax = fig.gca()
11
12ax.add_patch(circle1)
13ax.add_patch(circle2)
14ax.add_patch(circle3)
15
16fig.savefig('plotcircles.png')
17
1import matplotlib.pyplot as plt
2R = 1
3max_theta = 2* np.pi
4list_t = list(np.arange(0,max_theta,0.0001))
5x_circle = [(R*math.cos(x_y)) for x_y in list_t]
6y_circle = [(R*math.sin(x_y)) for x_y in list_t]
7#Plot
8fig = plt.figure()
9fig.set_size_inches(8, 8)
10ax = fig.add_axes([0.15,0.2,0.7,0.7])
11ax.plot(x_circle, y_circle, linestyle = 'solid', color = 'black')