Skip to content

Commit

Permalink
add background color to plot items
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Dec 18, 2024
1 parent e9934b7 commit 8f61507
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions iblrig/gui/online_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def __init__(self, parent: QObject):
self.horizontalHeader().setStretchLastSection(True)
self.setStyleSheet(
'QHeaderView::section { border: none; background-color: white; }'
'QTableView::item:selected { color: black; selection-background-color: rgba(0, 0, 0, 10%); }'
'QTableView::item:selected { color: black; selection-background-color: rgb(250, 250, 250); }'
'QTableView { background-color: rgba(0, 0, 0, 3%); }'
)
self.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
Expand Down Expand Up @@ -456,6 +457,7 @@ def __init__(self, raw_data_folder: DirectoryPath, parent: QObject | None = None
self.psychometricFunction = pg.PlotWidget(parent=self, background='white')
layout.addWidget(self.psychometricFunction, 2, 1, 1, 1)
self.psychometricFunction.plotItem.setTitle('Psychometric Function', color='k')
self.psychometricFunction.plotItem.getViewBox().setBackgroundColor(pg.mkColor(250, 250, 250))
self.psychometricFunction.plotItem.getAxis('left').setLabel('Rightward Choices (%)')
self.psychometricFunction.plotItem.getAxis('bottom').setLabel('Signed Contrast')
for axis in ('left', 'bottom'):
Expand All @@ -480,14 +482,15 @@ def __init__(self, raw_data_folder: DirectoryPath, parent: QObject | None = None
pen=pg.mkPen(color=color, width=2),
symbolPen=color,
symbolBrush=color,
symbolSize=7
symbolSize=7,
)
legend.addItem(self.psychometricPlotItems[p], f'p = {p:0.1f}')

# chronometric function
self.chronometricFunction = pg.PlotWidget(parent=self, background='white')
layout.addWidget(self.chronometricFunction, 3, 1, 1, 1)
self.chronometricFunction.plotItem.setTitle('Chronometric Function', color='k')
self.chronometricFunction.plotItem.getViewBox().setBackgroundColor(pg.mkColor(250, 250, 250))
self.chronometricFunction.plotItem.getAxis('left').setLabel('Response Time (s)')
self.chronometricFunction.plotItem.getAxis('bottom').setLabel('Signed Contrast')
for axis in ('left', 'bottom'):
Expand All @@ -513,7 +516,7 @@ def __init__(self, raw_data_folder: DirectoryPath, parent: QObject | None = None
pen=pg.mkPen(color=color, width=2),
symbolPen=color,
symbolBrush=color,
symbolSize=7
symbolSize=7,
)
legend.addItem(self.chronometricPlotItems[p], f'p = {p:0.1f}')

Expand Down

0 comments on commit 8f61507

Please sign in to comment.