|
10 | 10 | # may be distributed without limitation. |
11 | 11 |
|
12 | 12 | from __future__ import unicode_literals |
13 | | -import sys, os, random |
| 13 | +import sys |
| 14 | +import os |
| 15 | +import random |
14 | 16 | from matplotlib.backends import qt4_compat |
15 | 17 | use_pyside = qt4_compat.QT_API == qt4_compat.QT_API_PYSIDE |
16 | 18 | if use_pyside: |
@@ -62,18 +64,18 @@ class MyDynamicMplCanvas(MyMplCanvas): |
62 | 64 | def __init__(self, *args, **kwargs): |
63 | 65 | MyMplCanvas.__init__(self, *args, **kwargs) |
64 | 66 | timer = QtCore.QTimer(self) |
65 | | - if use_pyside: |
| 67 | + if use_pyside: |
66 | 68 | timer.timeout.connect(self.update_figure) |
67 | 69 | else: |
68 | 70 | QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"), self.update_figure) |
69 | 71 | timer.start(1000) |
70 | 72 |
|
71 | 73 | def compute_initial_figure(self): |
72 | | - self.axes.plot([0, 1, 2, 3], [1, 2, 0, 4], 'r') |
| 74 | + self.axes.plot([0, 1, 2, 3], [1, 2, 0, 4], 'r') |
73 | 75 |
|
74 | 76 | def update_figure(self): |
75 | 77 | # Build a list of 4 random integers between 0 and 10 (both inclusive) |
76 | | - l = [ random.randint(0, 10) for i in range(4) ] |
| 78 | + l = [random.randint(0, 10) for i in range(4)] |
77 | 79 |
|
78 | 80 | self.axes.plot([0, 1, 2, 3], l, 'r') |
79 | 81 | self.draw() |
|
0 commit comments