def setColorSchemeWhite(self):
"""
Set the plot background to white . This will also automatically change trace colours.
"""
self.properties['colorScheme']='white'
for plot in self.plots2D:
try:
plot.setBackground((252,252,245, 255))
except:
pass
for a in ['left','bottom','right']:
try:
axis = plot.getAxis(a)
axis.setPen('k')
except:
pass
n=0
if isinstance(plot, pg.widgets.PlotWidget.PlotWidget): #Only consider curves part of the main left axis
for c in self.plots2D[plot]: #Change curve colors to match white background
c.setPen(color=self.white_trace_colors[n], width=3)
n+=1
if(n==54):break
try:
for d in self.plots2D[plot].viewBoxes: #Go through the additional axes too
for f in self.plots2D[d]:
f.setPen(color=self.white_trace_colors[n], width=3)
n+=1
if(n==54):break
except: pass
try:
for d in plot.axisItems: #Go through any additional axes, and set colors there too
d.setPen('k')
except Exception as ex: print ('error while changing scheme',ex)
评论列表
文章目录