Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a difference between pyplot Circle and patches Circle?

I tried to check the documentation, but I couldn’t find matplotlib.Circle in it. I also checked matplotlib.patches.circle and couldn’t see anything saying that matplotlib.Circle is a place holder of matplotlib.patches.circle.

Do they operate differently?

Thank you.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Edit: I forgot that plt is a very common abbreviation for matplotlib.pyplot rather than matplotlib itself, which resulted in this question.

>Solution :

I guess you’re referring to matplotlib.pyplot.Circle and matplotlib.patches.Circle. A quick check:

>>> import matplotlib
>>> matplotlib.patches.Circle is matplotlib.pyplot.Circle
True

This means that both classes are the same object. This happens because matplotlib.pyplot imports Circle from matplotlib.patches (source code at GitHub):

# Line 76 at matplotlib/pyplot.py (tag "v3.5.1")
from matplotlib.patches import Polygon, Rectangle, Circle, Arrow
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading