[pitivi] Use Matplotlib OO API in test code.



commit 33e736100133a2ff9c4c01b591bf0a72ccaeff45
Author: Elliott Sales de Andrade <quantum analyst gmail com>
Date:   Sun Jun 17 02:26:43 2018 -0400

    Use Matplotlib OO API in test code.

 pitivi/autoaligner.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/autoaligner.py b/pitivi/autoaligner.py
index 161b4fc2..076cc375 100644
--- a/pitivi/autoaligner.py
+++ b/pitivi/autoaligner.py
@@ -676,9 +676,9 @@ if __name__ == '__main__':
     reference = envelopes[-1]
     offsets, drifts = affinealign(reference, envelopes, 0.02)
     print(offsets, drifts)
-    from matplotlib.pyplot import *
-    clf()
-    for i in range(len(envelopes)):
-        t = offsets[i] + (1 + drifts[i]) * numpy.arange(len(envelopes[i]))
-        plot(t, envelopes[i] / numpy.sqrt(numpy.sum(envelopes[i] ** 2)))
-    show()
+    import matplotlib.pyplot as plt
+    fig, ax = plt.subplots()
+    for o, d, e in zip(offsets, drifts, envelopes):
+        t = o + (1 + d) * numpy.arange(len(e))
+        ax.plot(t, e / numpy.sqrt(numpy.sum(e ** 2)))
+    plt.show()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]