utilitiesClass.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:pslab-desktop-apps 作者: fossasia 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号