आपको इसे एक अक्ष में जोड़ने की आवश्यकता है। A Circleएक उप का वर्ग है Artist, और axesएक add_artistविधि है।
यहाँ ऐसा करने का एक उदाहरण दिया गया है:
import matplotlib.pyplot as plt
circle1 = plt.Circle((0, 0), 0.2, color='r')
circle2 = plt.Circle((0.5, 0.5), 0.2, color='blue')
circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False)
fig, ax = plt.subplots() # note we must use plt.subplots, not plt.subplot
# (or if you have an existing figure)
# fig = plt.gcf()
# ax = fig.gca()
ax.add_artist(circle1)
ax.add_artist(circle2)
ax.add_artist(circle3)
fig.savefig('plotcircles.png')
यह निम्नलिखित आंकड़े में परिणाम है:

पहला सर्कल मूल में है, लेकिन डिफ़ॉल्ट रूप से clip_onहै True, इसलिए सर्कल को क्लिप किया जाता है जब कभी भी यह परे से बाहर निकलता है axes। तीसरा (हरा) सर्कल दिखाता है कि जब आप क्लिप नहीं करते हैं तो क्या होता है Artist। यह कुल्हाड़ियों से परे फैली हुई है (लेकिन आकृति से परे नहीं, यानी आंकड़ा आकार स्वचालित रूप से आपके सभी कलाकारों को प्लॉट करने के लिए समायोजित नहीं होता है)।
डिफ़ॉल्ट रूप से x, y और त्रिज्या के लिए इकाइयों डेटा इकाइयों के अनुरूप हैं। इस मामले में, मैंने अपनी कुल्हाड़ियों पर कुछ भी साजिश नहीं की ( fig.gca()वर्तमान कुल्हाड़ियों को लौटाता है), और चूंकि सीमाएं कभी भी निर्धारित नहीं की गई हैं, वे एक एक्स और वाई श्रेणी में 0 से 1 तक चूक करते हैं।
यहाँ उदाहरणों की एक निरंतरता है, जो दिखाती है कि इकाइयाँ कैसे मायने रखती हैं:
circle1 = plt.Circle((0, 0), 2, color='r')
# now make a circle with no fill, which is good for hi-lighting key results
circle2 = plt.Circle((5, 5), 0.5, color='b', fill=False)
circle3 = plt.Circle((10, 10), 2, color='g', clip_on=False)
ax = plt.gca()
ax.cla() # clear things for fresh plot
# change default range so that new circles will work
ax.set_xlim((0, 10))
ax.set_ylim((0, 10))
# some data
ax.plot(range(11), 'o', color='black')
# key data point that we are encircling
ax.plot((5), (5), 'o', color='y')
ax.add_artist(circle1)
ax.add_artist(circle2)
ax.add_artist(circle3)
fig.savefig('plotcircles2.png')
जिसके परिणामस्वरूप:

आप यह देख सकते हैं कि मैंने दूसरे सर्कल के फिल को कैसे सेट किया है False, जो मुख्य परिणामों को घेरने के लिए उपयोगी है (जैसे मेरा पीला डेटा बिंदु)।