Skip to content

Commit

Permalink
auoscale QuickView when axes change and other minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Oct 9, 2019
1 parent 26ff0c6 commit 6c45f64
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 15 additions & 1 deletion shapeout2/gui/quick_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ def on_tool(self):
if self.toolButton_event.isChecked():
show_event = True
self.toolButton_settings.setChecked(False)
else:
# keep everything as-is but update the sizes
show_event = self.widget_event.isVisible()
show_settings = self.widget_settings.isVisible()
self.widget_event.setVisible(show_event)
self.widget_scatter.select.setVisible(show_event)

Expand Down Expand Up @@ -388,8 +392,13 @@ def show_rtdc(self, path, filters):

# set quick view state
self.__setstate__(state)
self.widget_scatter.select.hide()
# scatter plot
self.plot()
# select first event in event viewer (also updates selection point)
self.show_event(0)
# this only updates the size of the tools (because there is no
# sender)
self.on_tool()


class RTDCScatterWidget(pg.PlotWidget):
Expand All @@ -416,7 +425,12 @@ def setData(self, x, y, brush, xscale="linear", yscale="linear"):
else:
logy = False

# set data
self.scatter.setData(x=x, y=y, brush=brush)
# reset range (in case user modified it manually)
self.plotItem.setAutoPan()
self.plotItem.autoRange()
# set log mode
self.plotItem.setLogMode(x=logx, y=logy)
self.logx = logx
self.logy = logy
Expand Down
6 changes: 6 additions & 0 deletions shapeout2/gui/quick_view.ui
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
</property>
<item>
<widget class="QToolButton" name="toolButton_settings">
<property name="toolTip">
<string>Plot</string>
</property>
<property name="text">
<string/>
</property>
Expand All @@ -93,6 +96,9 @@
</item>
<item>
<widget class="QToolButton" name="toolButton_event">
<property name="toolTip">
<string>Event</string>
</property>
<property name="text">
<string/>
</property>
Expand Down

0 comments on commit 6c45f64

Please sign in to comment.