Skip to content

Commit

Permalink
Fix display range in the visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
corruptbear committed May 17, 2024
1 parent 1019b4d commit 3b1a40d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions software/management/dashboard/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def visualize_ranging_pair_slider(data1, data2, label1, label2, start_timestamp=
plt.subplots_adjust(bottom=0.25)

#time is expressed in days as floats
tmin = min(timestamps1[0], timestamps2[0])
tmax = max(timestamps1[-1], timestamps2[-1])
tmin = max(timestamps1[0], timestamps2[0])
tmax = min(timestamps1[-1], timestamps2[-1])
ymin = min(ranges1.min(), ranges2.min())
ymax = max(ranges2.max(), ranges2.max())
init_pos = tmin
Expand All @@ -173,6 +173,8 @@ def draw_indications(events, event_offset):
ax2.plot(timestamps2, ranges2)
ax1.yaxis.set_label_text(f'{label1}-{label2} {ylabel}')
ax2.yaxis.set_label_text(f'{label2}-{label1} {ylabel}')
ax1.set_xlim([tmin, tmax])
ax2.set_xlim([tmin, tmax])
ax1.set_ylim([0, ymax])
ax2.set_ylim([0, ymax])
#suppress the tick texts
Expand All @@ -183,6 +185,8 @@ def draw_indications(events, event_offset):

ax3.plot(timestamps1, ranges1)
ax4.plot(timestamps2, ranges2)
ax3.set_xlim([tmin, tmax])
ax4.set_xlim([tmin, tmax])
# suppress the tick texts
ax3.xaxis.set_ticklabels([])
plt.setp(ax3.get_xticklabels(), visible=False)
Expand Down

0 comments on commit 3b1a40d

Please sign in to comment.