當前位置: 首頁>>代碼示例>>Python>>正文


Python formsubplottool.UiSubplotTool類代碼示例

本文整理匯總了Python中matplotlib.backends.qt_editor.formsubplottool.UiSubplotTool的典型用法代碼示例。如果您正苦於以下問題:Python UiSubplotTool類的具體用法?Python UiSubplotTool怎麽用?Python UiSubplotTool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了UiSubplotTool類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, targetfig, parent):
        UiSubplotTool.__init__(self, None)

        self.targetfig = targetfig
        self.parent = parent
        self.donebutton.clicked.connect(self.close)
        self.resetbutton.clicked.connect(self.reset)
        self.tightlayout.clicked.connect(self.functight)

        # constraints
        self.sliderleft.valueChanged.connect(self.sliderright.setMinimum)
        self.sliderright.valueChanged.connect(self.sliderleft.setMaximum)
        self.sliderbottom.valueChanged.connect(self.slidertop.setMinimum)
        self.slidertop.valueChanged.connect(self.sliderbottom.setMaximum)

        self.defaults = {}
        for attr in ('left', 'bottom', 'right', 'top', 'wspace', 'hspace', ):
            self.defaults[attr] = getattr(self.targetfig.subplotpars, attr)
            slider = getattr(self, 'slider' + attr)
            slider.setMinimum(0)
            slider.setMaximum(1000)
            slider.setSingleStep(5)
            slider.valueChanged.connect(getattr(self, 'func' + attr))

        self._setSliderPositions()
開發者ID:Acanthostega,項目名稱:matplotlib,代碼行數:25,代碼來源:backend_qt5.py

示例2: __init__

    def __init__(self, targetfig, parent):
        UiSubplotTool.__init__(self, None)

        self._figure = targetfig

        for lower, higher in [("bottom", "top"), ("left", "right")]:
            self._widgets[lower].valueChanged.connect(
                lambda val: self._widgets[higher].setMinimum(val + .001))
            self._widgets[higher].valueChanged.connect(
                lambda val: self._widgets[lower].setMaximum(val - .001))

        self._attrs = ["top", "bottom", "left", "right", "hspace", "wspace"]
        self._defaults = {attr: vars(self._figure.subplotpars)[attr]
                          for attr in self._attrs}

        # Set values after setting the range callbacks, but before setting up
        # the redraw callbacks.
        self._reset()

        for attr in self._attrs:
            self._widgets[attr].valueChanged.connect(self._on_value_changed)
        for action, method in [("Export values", self._export_values),
                               ("Tight layout", self._tight_layout),
                               ("Reset", self._reset),
                               ("Close", self.close)]:
            self._widgets[action].clicked.connect(method)
開發者ID:endolith,項目名稱:matplotlib,代碼行數:26,代碼來源:backend_qt5.py

示例3: __init__

    def __init__(self, targetfig, parent):
        UiSubplotTool.__init__(self, None)

        self.targetfig = targetfig
        self.parent = parent
        self.donebutton.clicked.connect(self.close)
        self.resetbutton.clicked.connect(self.reset)
        self.tightlayout.clicked.connect(self.functight)

        # constraints
        self.sliderleft.valueChanged.connect(self.sliderright.setMinimum)
        self.sliderright.valueChanged.connect(self.sliderleft.setMaximum)
        self.sliderbottom.valueChanged.connect(self.slidertop.setMinimum)
        self.slidertop.valueChanged.connect(self.sliderbottom.setMaximum)

        self.defaults = {}
        for attr in ('left', 'bottom', 'right', 'top', 'wspace', 'hspace', ):
            val = getattr(self.targetfig.subplotpars, attr)
            self.defaults[attr] = val
            slider = getattr(self, 'slider' + attr)
            txt = getattr(self, attr + 'value')
            slider.setMinimum(0)
            slider.setMaximum(1000)
            slider.setSingleStep(5)
            # do this before hooking up the callbacks
            slider.setSliderPosition(int(val * 1000))
            txt.setText("%.2f" % val)
            slider.valueChanged.connect(getattr(self, 'func' + attr))
        self._setSliderPositions()
開發者ID:kshramt,項目名稱:matplotlib,代碼行數:29,代碼來源:backend_qt5.py


注:本文中的matplotlib.backends.qt_editor.formsubplottool.UiSubplotTool類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。