How do I get a figure to have a 1:1 aspect ratio? I currently have the following figure
import matplotlib.pyplot as plt
circle1 = plt.Circle((0.5, 0.5), 0.2, color='r')
fig, ax = plt.subplots()
ax.add_artist(circle1)
But the x-axis is bigger than the y-axis. I tried using the command I found here :
import matplotlib.pyplot as plt
circle1 = plt.Circle((0.5, 0.5), 0.2, color='r')
fig, ax = plt.subplots()
ax.add_artist(circle1)
plt.axes().set_aspect('equal', 'datalim')
but then the circle I drew disappears.
How can I set an equal aspect ratio?