Menu

[r4631]: / branches / transforms / examples / legend_scatter.py  Maximize  Restore  History

Download this file

22 lines (14 with data), 378 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
from pylab import *
N=1000
props = dict( alpha=0.5, faceted=False )
handles = []
colours = ['red', 'green', 'blue', 'magenta', 'cyan', 'yellow']
colours = ['red', 'green', 'blue']
for colour in colours:
x, y = rand(2,N)
s = 400.0 * rand(N)
handles.append(scatter(x, y, c=colour, s=s, **props))
legend(handles, colours)
grid(True)
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.