File: scatter_star_poly.py

package info (click to toggle)
matplotlib 1.1.1~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 66,076 kB
  • sloc: python: 90,600; cpp: 69,891; objc: 5,231; ansic: 1,723; makefile: 171; sh: 7
file content (30 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import numpy as np
import matplotlib.pyplot as plt


x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)

plt.subplot(321)
plt.scatter(x,y,s=80, c=z, marker=">")

plt.subplot(322)
plt.scatter(x,y,s=80, c=z, marker=(5,0))

verts = zip([-1.,1.,1.,-1.],[-1.,-1.,1.,-1.])
plt.subplot(323)
plt.scatter(x,y,s=80, c=z, marker=(verts,0))
# equivalent:
#plt.scatter(x,y,s=80, c=z, marker=None, verts=verts)

plt.subplot(324)
plt.scatter(x,y,s=80, c=z, marker=(5,1))

plt.subplot(325)
plt.scatter(x,y,s=80, c=z, marker='+')

plt.subplot(326)
plt.scatter(x,y,s=80, c=z, marker=(5,2))

plt.show()