matplotlib x y limit and aspect ratio

#Python #Matplotlib

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.

Published: by ;

Table of Contents

Current Ref:

  • til/programming/matplotlib-x-y-limit-and-aspect-ratio.md