1

matplotlib showing unequal axis

As one can see from the above picture, 1 unit on x-asis of the graph is different from that on y-axis (in terms of length). (So you see rectangle instead of square.)

I would like to ask how can I make it the same? Thanks in advance.

Martin Evans
  • 43,220
  • 16
  • 78
  • 90
Dennis
  • 175
  • 1
  • 2
  • 7

1 Answers1

1

You can force matplotlib to use the same scaling for both axes by adding the following to your plot:

plt.axis('equal')

More information can be found here: axis_equal_demo.py

Martin Evans
  • 43,220
  • 16
  • 78
  • 90