Skip to content

Commit 7f5e375

Browse files
Leonardo RanzaniLeonardo Ranzani
authored andcommitted
fixed plot client compatibility with python 3. Maybe it will fix crashes too?
1 parent a999a2e commit 7f5e375

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

utils/auspex-plot-client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
from PyQt5.QtGui import QIcon
3939

4040
import numpy as np
41-
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
42-
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
41+
#replaced qt4agg and qt5agg with qtagg for compatibility with python > 3.5
42+
from matplotlib.backends.backend_qtagg import NavigationToolbar2QT as NavigationToolbar
43+
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas
4344
from matplotlib.figure import Figure
4445
from matplotlib.pyplot import subplots
4546

@@ -137,7 +138,7 @@ def loop(self):
137138
def label_offset(ax): #, axis="y"):
138139
ax.xaxis.offsetText.set_visible(False)
139140
ax.yaxis.offsetText.set_visible(False)
140-
141+
141142
def update_label(event_axes):
142143
if event_axes:
143144
old_xlabel = event_axes.get_xlabel()
@@ -153,7 +154,7 @@ def update_label(event_axes):
153154
else:
154155
offset_x = ''
155156
if offset_y != 0:
156-
offset_y = r" (10$^{"+ str(offset_y) + r"}$)"
157+
offset_y = r" (10$^{"+ str(offset_y) + r"}$)"
157158
else:
158159
offset_y = ''
159160
ax.set_xlabel(old_xlabel + offset_x)
@@ -345,7 +346,7 @@ def set_desc(self, desc):
345346
else:
346347
offset_x = ''
347348
if offset_y != 0:
348-
offset_y = r" (10$^{"+ str(offset_y) + r"}$)"
349+
offset_y = r" (10$^{"+ str(offset_y) + r"}$)"
349350
else:
350351
offset_y = ''
351352
if 'x_label' in desc.keys():
@@ -413,7 +414,7 @@ def build_main_window(self, setMethod = None):
413414

414415
def init_comms(self):
415416
self.context = zmq.Context()
416-
417+
417418
self.uuid = None
418419
self.data_listener_thread = None
419420

0 commit comments

Comments
 (0)