- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Plot a circle with an edgecolor and hatch in Matplotlib
To place edge color and hatch of a circle in matplotlib, we can take the following steps −
Create a new figure or activate an existing figure using figure() method.
Add a subplot method to the current axis.
Create a circle instance using Circle() class with an edgecolor, hatch and linewidth of the edge.
Add a circle path on the plot.
To place the text in the circle, use text() method.
Scale X and Y axes using xlim() and ylim() methods.
To display the figure, use show() method.
Example
import matplotlib from matplotlib import pyplot as plt, patches plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True fig = plt.figure() ax = fig.add_subplot(111) circle = matplotlib.patches.Circle((0, 0), radius=1, edgecolor="orange", linewidth=2, hatch="o") ax.add_patch(circle) plt.text(-.25, 0, "Circle") plt.xlim([-4, 4]) plt.ylim([-4, 4]) plt.show()
Output
- Related Articles
- Plot a circle with an edgecolor in Matplotlib
- Plot a rectangle with an edgecolor in Matplotlib
- How to plot a circle in Matplotlib?
- Plot a circle inside a rectangle in Matplotlib
- How to fill a polygon with a custom hatch in Matplotlib?
- How to plot a rectangle inside a circle in Matplotlib?
- How to decouple hatch and edge color in Matplotlib?
- How to plot a half-black and half-white circle using Matplotlib?
- How to change the linewidth of a hatch in Matplotlib?
- How to decrease the hatch density in Matplotlib?
- How to set different opacity of edgecolor and facecolor of a patch in Matplotlib?
- How do I fill a region with only hatch (no background colour) in matplotlib 2.0?
- Line plot with arrows in Matplotlib
- Plot numpy datetime64 with Matplotlib
- Plot Matplotlib 3D plot_surface with contour plot projection

Advertisements