当前位置: 首页>>代码示例>>Python>>正文


Python FigureCanvasQTAgg.setMaximumWidth方法代码示例

本文整理汇总了Python中matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.setMaximumWidth方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.setMaximumWidth方法的具体用法?Python FigureCanvasQTAgg.setMaximumWidth怎么用?Python FigureCanvasQTAgg.setMaximumWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg的用法示例。


在下文中一共展示了FigureCanvasQTAgg.setMaximumWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SettingsWidget

# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import setMaximumWidth [as 别名]

#.........这里部分代码省略.........
        self.gausFitting.addItem('None')
        self.gausFitting.addItem('1')
        self.gausFitting.addItem('2')
        self.gausFitting.addItem('3')
        self.gausFitting.addItem('4')
        self.gausFitting.addItem('5')
        self.gausFitting.setCurrentIndex(0)        
        self.gausFitting.currentIndexChanged.connect(self.collectSettings)
        mainLayout.addWidget(self.gausFitting,16,2,1,2) 
        
###################### FORMULAS ############################  

        windowColor = str(self.palette().color(QtGui.QPalette.Window).name())    
        self.figure = plt.figure(facecolor=windowColor)
        self.canvas = FigureCanvas(self.figure)
        mainLayout.addWidget(self.canvas,17,0,1,4)
        mainLayout.setAlignment(QtCore.Qt.AlignTop)
        self.drawFormulas()
        self.changeHideStatus()
        
    def drawFormulas(self):
        self.figure.clf()
        self.figure.suptitle(r"$E=\frac{F_a}{F_a+\gamma_d F_d}$" "\n"
                            r"$F_d=I_d - B_d -\alpha_{ad}(I_a-B_a)$" "\n"
                            r"$F_a=I_a - B_a -\alpha_{da}(I_d-B_d)-DE_a$" "\n" 
                            r"$\gamma_d=\frac{\Phi_a k_a}{\Phi_d k_d}= " + 
                            str(round((self.QA.value()*self.kA.value())/(self.QD.value()*self.kD.value()),4))+ "$\n"
                            r"$I - intensity, B - background$" "\n"
                            r"$\alpha - crosstalk, \gamma - instr.coef.$" ,
                      x=0.0, y=0.5, 
                      fontsize=18,
                      horizontalalignment='left',
                      verticalalignment='center')
        self.canvas.setMaximumWidth(278)
        self.canvas.setMaximumHeight(190)
        self.canvas.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)        
        self.canvas.draw()

    def changeHideStatus(self):
        if self.BackGrSubMethod.currentText()=='Manual':
            self.BAtext.show()
            self.BA.show()
            self.BDtext.show()        
            self.BD.show()
        elif self.BackGrSubMethod.currentText()=='Auto (gauss)':
            self.BAtext.hide()
            self.BA.hide()
            self.BDtext.hide()        
            self.BD.hide()
            
        if (self.ThresholdLogic.currentText()=='OR') | (self.ThresholdLogic.currentText()=='AND'):
            self.ThresholdMethod.model().item(2).setEnabled(True)
            self.ThresholdLogic.model().item(2).setEnabled(True)
            if self.ThresholdMethod.currentText()=='Auto (gauss)':
                self.CD.show()
                self.CDtext.show()       
                self.CA.show()
                self.CAtext.show() 
                self.TD.hide()
                self.TDtext.hide()
                self.TA.hide()
                self.TAtext.hide()       
                self.ThresholdLogic.model().item(2).setEnabled(True)
                self.ND.hide()
                self.NDtext.hide()
                self.NA.hide()
开发者ID:satary,项目名称:fretty,代码行数:70,代码来源:settings_widget.py


注:本文中的matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.setMaximumWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。