Menu

[r4812]: / trunk / htdocs / examples / figlegend_demo.py  Maximize  Restore  History

Download this file

19 lines (14 with data), 412 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
from pylab import *
ax1 = axes([0.1, 0.1, 0.4, 0.7])
ax2 = axes([0.55, 0.1, 0.4, 0.7])
x = arange(0.0, 2.0, 0.02)
y1 = sin(2*pi*x)
y2 = exp(-x)
l1, l2 = ax1.plot(x, y1, 'rs-', x, y2, 'go')
y3 = sin(4*pi*x)
y4 = exp(-2*x)
l3, l4 = ax2.plot(x, y3, 'yd-', x, y3, 'k^')
figlegend((l1, l2), ('Line 1', 'Line 2'), 'upper left')
figlegend((l3, l4), ('Line 3', 'Line 4'), 'upper right')
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.