Skip to content

Instantly share code, notes, and snippets.

@Nagyman
Last active December 20, 2015 20:59
Show Gist options
  • Save Nagyman/6193955 to your computer and use it in GitHub Desktop.
Save Nagyman/6193955 to your computer and use it in GitHub Desktop.
from trips.models import *
import matplotlib.pyplot as plt
counts = []
for t in Trip.objects.published():
counts.append(len(t.visited_countries.all()))
plt.hist(counts)
plt.title("Visited Countries")
plt.xlabel("Number of Countries")
plt.ylabel("Frequency")
plt.savefig('/Users/craign/visited_countries.png')
print "test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment