Week 10 — Open Data Project

TA
Design Computing
Published in
1 min readMay 15, 2017

This week we continued working on the Open Data Project. I tried to make graphs and plots look pretty before getting graphs of everything else (This is probably the opposite of what I should be doing right now).

  • Plotting is uglier on the VM compared to my local machine

I’ll focus on the graphs first, but then I’ll move onto manipulating the data to get much more feasible results.

A bar graph representing the age of all pets

See how much nicer it is with Python’s OS X app?

Relevant code:

plt.hist(df[“age”][df[“age”] < 30], 29, facecolor=”blue”, alpha=0.75)
plt.xlabel(“Age”, fontsize=20)
plt.ylabel(“Number of pets”, fontsize=20)
plt.title(“List of all animals and their age”)
plt.grid(True, axis=’x’, ls=’:’)
plt.show()

  • Shows ages up to 30, blue-coloured graph, 0.75 alpha (so it’s somewhat translucent)
  • plt.xlabel/plt.ylabel/plt.title are self explanatory
  • plt.grid gives us those dotted vertical lines.

--

--