Dark Hypernova
Science and Fiction

Today I Learned

matplotlib x y limit and aspect ratio

Use

plt.xlim(-1,1)
plt.gca().set_aspect('equal', adjustable='box')

if

plt.xlim(-1,1)
plt.axes().set_aspect('equal', 'datalim')

doesn’t work.

A Random #TIL# for You

By OctoMiao

Last updated