Menu

[r498]: / trunk / htdocs / examples / test.py  Maximize  Restore  History

Download this file

30 lines (20 with data), 513 Bytes

 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
from matplotlib.matlab import figure, close, axes, subplot, show
from matplotlib.numerix import arange, sin, pi
t = arange(0.0, 1.0, 0.01)
figure(1)
ax1 = subplot(211)
plot(t, sin(2*pi*t))
grid(True)
ax1.set_ylim( (-2,2) )
ylabel('1 Hz')
title('A sine wave or two')
for label in ax1.get_xticklabels():
label.set_color('r')
ax2 = fig.add_subplot(212)
ax2.plot(t, sin(2*2*pi*t))
ax2.grid(True)
ax2.set_ylim( (-2,2) )
l = ax2.set_xlabel('Hi mom')
l.set_color('g')
l.set_fontsize('large')
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.