I need to match the resolution of x- and y-axes in matplotlib, so that the linear function y=x would plot as an exactly 45° line, and so that a mathematically plotted circle (r^2=x^2+y^2) would appear round.
This because I’m plotting geographical data, and would like a given distance measured along the x-axis to equal the distance measured along the y-axis. I’m rather new to MatPlotLib, and have problems finding the answer in the documentation.
Edit: This could be accomplished by manually setting an pixels-per-unit-ratio for both axes. Is this possible? If so, how?
You can do that with
axes.set_aspect. For example: