1. Miki Tebeka
  2. pythonwise

Commits

Miki Tebeka  committed c477e9a

comments

  • Participants
  • Parent commits baf08b0
  • Branches default

Comments (0)

Files changed (1)

File ll-freq.py

View file
     width = 0.35  # Bar width (also used for xticks positioning)
 
     idx = np.arange(len(freq))
-    xs = sorted(freq)
-    ys = [freq[x] for x in xs]
+    xs = sorted(freq)  # Letters in alphabetic order
+    ys = [freq[x] for x in xs]  # Frequency
 
     plt.bar(idx, ys, width=width)
-    plt.xticks(idx + width/2., xs)
+    plt.xticks(idx + width/2., xs)  # Annotate X axis
     plt.title('Last Letter Frequency')
     plt.savefig(filename)