SORU
21 EKİM 2012, Pazar


Matplot lib bir arsa xticks kaldırmak?

Semilogx bir arsa var ve xticks kaldırmak istiyorum. Denedim :

plt.gca().set_xticks([])
plt.xticks([])
ax.set_xticks([])

Kılavuz yok (tamam), ama küçük keneler (ana kenelerin yerde) kalır. Nasıl bunları kaldırmak için ?

CEVAP
21 EKİM 2012, Pazar


tick_params yöntem bu gibi şeyler için çok yararlıdır. Bu kodu büyük ve küçük keneler kapatır ve x ekseni etiketleri kaldırır.

from matplotlib import pyplot as plt
plt.plot(range(10))
plt.tick_params(
    axis='x',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    bottom='off',      # ticks along the bottom edge are off
    top='off',         # ticks along the top edge are off
    labelbottom='off') # labels along the bottom edge are off
plt.show()
plt.savefig('plot')
plt.clf()

enter image description here

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • adrianisen

    adrianisen

    25 Kasım 2009
  • Helder Barreto

    Helder Barre

    22 Mayıs 2006
  • J Medema

    J Medema

    11 EKİM 2006