# How to Plot Circles in Matplotlib (With Examples)

You can quickly add circles to a plot in Matplotlib by using the Circle() function, which uses the following syntax:

where:

• xy: The (x, y) coordinates for the circle

This tutorial shows several examples of how to use this function in practice:

### Example 1: Create a Single Circle

The following code shows how to create a single circle on a Matplotlib plot located at (x, y) coordinates (10,10):

```import matplotlib.pyplot as plt

#set axis limits of plot (x=0 to 20, y=0 to 20)
plt.axis([0, 20, 0, 20])

#create circle with (x, y) coordinates at (10, 10)
c=plt.Circle((10, 10))

#add circle to plot (gca means "get current axis")
``` By default, one axis of a Matplotlib plot typically displays more pixels per data unit. To make a circle appear as a circle instead of an ellipse, you need to use the argument plt.axis(“equal”) as follows:

```import matplotlib.pyplot as plt

#set axis limits of plot (x=0 to 20, y=0 to 20)
plt.axis([0, 20, 0, 20])
plt.axis("equal")

#create circle with (x, y) coordinates at (10, 10)
c=plt.Circle((10, 10))

#add circle to plot (gca means "get current axis") ### Example 2: Create Multiple Circles

The following code shows how to create multiple circles on a Matplotlib plot:

```import matplotlib.pyplot as plt

#set axis limits of plot (x=0 to 20, y=0 to 20)
plt.axis([0, 20, 0, 20])
plt.axis("equal")

#define circles

``` ### Example 3: Modify Circle Appearance

You can use the following arguments to modify the appearance of a circle in Matplotlib:

• color: Specify color of circle
• alpha: Specify transparency of circle

The following code shows an example of how to use several of these arguments at once:

```import matplotlib.pyplot as plt

#set axis limits of plot (x=0 to 20, y=0 to 20)
plt.axis([0, 20, 0, 20])
plt.axis("equal")

#create circle with (x, y) coordinates at (10, 10) 