Skip to content

Instantly share code, notes, and snippets.

@busterroni
Created March 19, 2016 22:30
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 busterroni/c5fd68a40626c3639120 to your computer and use it in GitHub Desktop.
Save busterroni/c5fd68a40626c3639120 to your computer and use it in GitHub Desktop.
import json, collections, plotly.plotly as plotly
with open("tagpromatches.json") as f:
data=json.load(f)
port_counts=collections.Counter(match['port'] for match in data.values())
fig= {
'data': [{
'labels': port_counts.keys(),
'values': port_counts.values(),
'type': 'pie',
}],
'layout': {'title': 'TagPro Port Distribution'}
}
plotly.plot(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment