Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the 'datalim' attribute do?

For a given python plot, what would the following do?

pl.gca().set_aspect('equal', 'datalim')

equal: make 1 increment in the y axis be the same as 1 increment in the x axis. But what does the 'datalim' attribute do?


1 Answers

You specify 'datalim' or 'box'. The former changes the limits on the axes to get the required aspect ration (in your case 1:1). The latter changes the box that being plotted in's aspect ratio.

Feel free to test the two -- the difference should be immediately clear.

like image 191
Mike Graham Avatar answered Jul 22 '26 12:07

Mike Graham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!