Search code examples
pythonmatplotlibscale

Scaling in matplotlib.pyplot?


I am generating planar coordinates within the range (x,y) in [0,500]x[0,500]. When using matplotlib.pyplot to visualize them, the axes only show the part that contains already generated points. How can I scale the axes so that they correspond to [0,500]x[0,500]?

This is what I have for now:

enter image description here


Solution

  • Use ax.set_xlim([0, 500]) and set_ylim