Ben pyplot/matplotlib ile python bir çizgi grafik yaptık: my x ekseni üzerindeX koordinatlarını harfleri nasıl yaparım?
import matplotlib.pyplot as plt
import math
import numpy as np
alphabet = range(0, 25)
firstLine = [letter + 65 for letter in alphabet]
secondLine = [letter + 97 for letter in alphabet]
plt.plot(alphabet, firstLine, '-b', label='ASCII value of capital.')
plt.plot(alphabet, secondLine, '--g', label='ASCII value of lowercase.')
plt.xlabel('Letter in Alphabet')
plt.ylabel('ASCII Value')
plt.title('ASCII value vs. Letter')
plt.legend()
plt.show()
, sayılarla mevcut ölçekler. Ancak, 0, 5, 10 yerine harflerle (a, b, c, d) etiketlenecek x ekseninde artışlar istiyorum. Özellikle, 'a' harfinin 0 ile eşleşmesini istiyorum. b '1 ile eşlemek için, vb.
Bunu nasıl yapabilirim?
Teşekkürler! pyplot.xticks (np.arange (0, 26), string.lowercase) 'işleri! – dangerChihuahua007