Skip to content

Instantly share code, notes, and snippets.

@prakhar21
Created July 4, 2021 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prakhar21/96679c997a21e139a44bf75d0ad1f157 to your computer and use it in GitHub Desktop.
Save prakhar21/96679c997a21e139a44bf75d0ad1f157 to your computer and use it in GitHub Desktop.
plot
y = readability_scores
N = len(y)
x = [i+1 for i in range(N)]
width = 1/1.5
mini = min(readability_scores)
maxi = max(readability_scores)
pylab.title("Readability Comparison of text")
pylab.xlabel("Book")
pylab.ylabel("Readability Score")
colors = ["yellow"]*7
colors[readability_scores.index(mini)] = "green"
colors[readability_scores.index(maxi)] = "red"
plt.bar(x, y, width, align='center', color=colors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment