Avec matplotlib vous pouvez facilement changer l'intervalle des x [xmin,xmax] et des y [ymin,ymax] en utilisant xlim et ylim respectivement, illustration:

import matplotlib.pyplot as pltx = [1,2,3,4,5,6,7,8,9]y = [10,9,8,7,6,5,4,3,2]plt.scatter(x,y,s=100)plt.xlim(-5,20)plt.ylim(0,15)plt.show()
Note: il est possible de modifier uniquement la borne supérieure ou inférieure:
plt.xlim(xmax=20)
ou
plt.xlim(xmin=-10)
Recherches associées
| Liens | Site |
|---|---|
| xlim | matplotlib doc |
| ylim | matplotlib doc |
| Python, Matplotlib, subplot: How to set the axis range? | stackoverflow |
| setting y-axis limit in matplotlib | stackoverflow |
| Changing plot scale by a factor in matplotlib | stackoverflow |
