I made a line graph in python with pyplot / matplotlib:
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()
On my x axis, the current scale is measured in numbers. However, I want the increments on the x axis to be marked with the letters (a, b, c, d) instead of saying 0, 5, 10 ... In particular, I want the letter "a" to appear in 0, b 'to display 1, etc.
How can i make pyplot?
source share