Skip to content

Instantly share code, notes, and snippets.

@jspeed-meyers
Created July 9, 2022 00:39
Show Gist options
  • Save jspeed-meyers/77a771cff1adc7d49cc9d7b2b3e1dfac to your computer and use it in GitHub Desktop.
Save jspeed-meyers/77a771cff1adc7d49cc9d7b2b3e1dfac to your computer and use it in GitHub Desktop.
Analyze scorecards data and create a histogram
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("csv/FILENAE.csv")
# create plot
fig, ax = plt.subplots(figsize=(6,4)) # size of sub-figures
n, _, _ = plt.hist(df.score, bins=[i/4 for i in range(0, 40)])
ax.bar(x=list(range(0, 1, 10)), height=n)
ax.set_title("Security Practice Scores for X Foundation GitHub Projects")
# set y axis range for each subplot
ax.set_ylim([0, 100]) # Will need to change depending on actual data
ax.set_xlim([1, 10])
fig.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment