Avec matplotlib il est possible de choisir de ne pas afficher certains axes, illustration:

import matplotlib.pyplot as pltfig, ax = plt.subplots()ax.spines['right'].set_visible(False)ax.spines['top'].set_visible(False)plt.plot([1,5],[1,5])plt.savefig("RemoveAxis.png")plt.show()
Ici les axes de droite (right) et du haut 'top' ne sont pas afficher (Note: pour ne pas afficher les axes du bas et de gauche: bottom and left). Pour ne pas afficher les "ticks" il suffit d'ajouter:
ax.xaxis.set_ticks_position('bottom')ax.yaxis.set_ticks_position('left')
Recherches associées
| Liens | Site |
|---|---|
| pylab_examples example code: spine_placement_demo.py | matplotlib doc |
| How to display only a left and bottom box border in matplotlib? | stackoverflow |
