Skip to content

Commit

Permalink
Fixed plotting error
Browse files Browse the repository at this point in the history
  • Loading branch information
eriffon committed Nov 28, 2024
1 parent 466ec0d commit 0c1bdf8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions hyo2/ssm2/app/gui/soundspeedmanager/widgets/dataplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ def _draw_speed(self):
color=self.seafloor_color,
linestyle=':',
label='depth')
self.speed_draft.set_ydata(None)
self.speed_sensor.set_xdata(None)
self.speed_seafloor.set_ydata(None)
self.speed_draft.set_ydata([None])
self.speed_sensor.set_xdata([None])
self.speed_seafloor.set_ydata([None])

self.speed_ax.set_label("speed")

Expand Down Expand Up @@ -549,9 +549,9 @@ def update_data(self):

if not self.lib.use_sis(): # in case that SIS was disabled
if self.speed_draft:
self.speed_draft.set_ydata(None)
self.speed_draft.set_ydata([None])
if self.speed_sensor:
self.speed_sensor.set_xdata(None)
self.speed_sensor.set_xdata([None])
return

# plot title
Expand All @@ -562,25 +562,25 @@ def update_data(self):
return

if self.lib.listeners.sis.xyz is None:
self.speed_draft.set_ydata(None)
self.speed_sensor.set_xdata(None)
self.speed_draft.set_ydata([None])
self.speed_sensor.set_xdata([None])
else:
# sensor speed
if self.lib.listeners.sis.xyz_transducer_sound_speed is None:
self.speed_sensor.set_xdata(None)
self.speed_sensor.set_xdata([None])
else:
self.speed_sensor.set_xdata([self.lib.listeners.sis.xyz_transducer_sound_speed, ])
# draft
if self.lib.listeners.sis.xyz_transducer_depth is None:
self.speed_draft.set_ydata(None)
self.speed_draft.set_ydata([None])
else:
self.speed_draft.set_ydata([self.lib.listeners.sis.xyz_transducer_depth, ])
# seafloor
mean_depth = self.lib.listeners.sis.xyz_mean_depth
if mean_depth:
self.speed_seafloor.set_ydata([mean_depth, ])
else:
self.speed_seafloor.set_ydata(None)
self.speed_seafloor.set_ydata([None])

def update_all_limits(self):
self.update_depth_limits()
Expand Down

0 comments on commit 0c1bdf8

Please sign in to comment.