Open Metric
Science, Fiction and Me

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


Most technical TILs will be updated at datumorphism.leima.is/til

By OctoMiao

Last updated