Skip to content

Commit 3562906

Browse files
committed
fix units update breaking chirp tab plot
1 parent 00dfa37 commit 3562906

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CLGui/ChirpTab.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ def update_chirp_length_units(index):
144144
self.chirp_length.min = clp.MIN_CHIRP_LENGTH
145145
self.chirp_length.max = clp.MAX_CHIRP_LENGTH
146146
self.chirp_length.set_value(clp.project['chirp_length'])
147+
148+
# workaround for X range not being set when data is too small and downsampling is being used https://github.com/pyqtgraph/pyqtgraph/issues/2328
149+
x_range = chirp_tab.graph.getViewBox().viewRange()[0]
150+
chirp_tab.graph.setXRange(x_range[0]/clp.project['sample_rate'],x_range[1]/clp.project['sample_rate'])
151+
chirp_tab.graph.enableAutoRange(axis='x')
147152
else:
148153
self.chirp_length.min = clp.MIN_CHIRP_LENGTH*clp.project['sample_rate']
149154
self.chirp_length.max = clp.MAX_CHIRP_LENGTH*clp.project['sample_rate']

0 commit comments

Comments
 (0)