File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change 20
20
21
21
# turn interactive mode on for dynamic updates. If you aren't in
22
22
# interactive mode, you'll need to use a GUI event handler/timer.
23
-
23
+ ion ()
24
24
25
25
tstart = time .time () # for profiling
26
26
x = arange (0 ,2 * pi ,0.01 ) # x-array
27
-
28
- ion ()
29
- fig = figure ()
30
- ax = subplot (111 )
31
27
line , = plot (x ,sin (x ))
32
- ax .animated [line ] = 1
33
-
34
- draw () # redraw the canvas
35
-
36
- N = 200
37
- for i in arange (1 ,N ):
28
+ for i in arange (1 ,200 ):
38
29
line .set_ydata (sin (x + i / 10.0 )) # update the data
39
- ax .draw_animate ()
40
- fig .canvas .blit ()
41
- #draw()
30
+ draw () # redraw the canvas
42
31
43
- print 'FPS:' , N / (time .time ()- tstart )
32
+ print 'FPS:' , 200 / (time .time ()- tstart )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
from pylab import *
3
+ rc ('text' , usetex = True )
3
4
figure (1 )
4
5
ax = axes ([0.1 , 0.1 , 0.8 , 0.7 ])
5
6
t = arange (0.0 , 1.0 + 0.01 , 0.01 )
9
10
xlabel (r'\bf{time (s)}' )
10
11
ylabel (r'\it{voltage (mV)}' ,fontsize = 16 )
11
12
title (r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!" ,
12
- { 'bbox' :{ 'fc' : 0.8 , 'pad' : 0 }}, fontsize = 16 , color = 'r' )
13
+ fontsize = 16 , color = 'r' )
13
14
grid (True )
14
15
savefig ('tex_demo.eps' )
15
16
You can’t perform that action at this time.
0 commit comments