Skip to content

Instantly share code, notes, and snippets.

@satomacoto
Created March 13, 2012 04:11
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 satomacoto/2026680 to your computer and use it in GitHub Desktop.
Save satomacoto/2026680 to your computer and use it in GitHub Desktop.
matplotlib - scatter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
data = """1 0.841470984807896
0.54030230586814 0.287797828416081
-0.416146836547142 0.172313864573127
-0.989992496600445 0.830544794233449
-0.653643620863612 0.414369558091726"""
for line in data.split('\n'):
x, y = map(lambda a: float(a), line.split('\t'))
plt.scatter(x, y)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment