本文整理汇总了Python中PyQt4.Qwt5.QwtPlot.enableAxis方法的典型用法代码示例。如果您正苦于以下问题:Python QwtPlot.enableAxis方法的具体用法?Python QwtPlot.enableAxis怎么用?Python QwtPlot.enableAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qwt5.QwtPlot
的用法示例。
在下文中一共展示了QwtPlot.enableAxis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_plot
# 需要导入模块: from PyQt4.Qwt5 import QwtPlot [as 别名]
# 或者: from PyQt4.Qwt5.QwtPlot import enableAxis [as 别名]
def add_plot(self, name, units):
# legend
legend = QwtLegend()
legend.setFrameStyle(Qt.QFrame.Box | Qt.QFrame.Sunken)
legend.setItemMode(QwtLegend.ClickableItem)
# plot
plot = QwtPlot(self)
plot.setTitle(name.upper())
plot.setObjectName(name)
plot.setCanvasBackground(Qt.Qt.white)
plot.setAxisTitle(QwtPlot.xBottom, "time [s]")
plot.insertLegend(legend, QwtPlot.RightLegend)
plot.time = deque(maxlen=MAX_LENGTH)
plot.data = []
plot.curves = []
for i, unit in enumerate(units):
position = QwtPlot.yLeft if i == 0 else QwtPlot.yRight
curve = QwtPlotCurve(LEGENDS[unit])
curve.setPen(Qt.QPen(self.next_color(), 2))
curve.setYAxis(position)
curve.attach(plot)
plot.enableAxis(position)
plot.setAxisTitle(position, unit)
plot.curves.append(curve)
plot.data.append(deque(maxlen=MAX_LENGTH))
self.vertical_layout.addWidget(plot)
self._plots[name] = plot
示例2: ImageControlDialog
# 需要导入模块: from PyQt4.Qwt5 import QwtPlot [as 别名]
# 或者: from PyQt4.Qwt5.QwtPlot import enableAxis [as 别名]
#.........这里部分代码省略.........
wlockall = QToolButton(self)
wlockall.setIcon(pixmaps.locked.icon())
wlockall.setText("Lock all to this")
wlockall.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
wlockall.setAutoRaise(True)
wlockall.setToolTip("""<P>Click this to lock together the intensity ranges of all images.</P>""")
lo1.addWidget(wlockall)
wunlockall = QToolButton(self)
wunlockall.setIcon(pixmaps.unlocked.icon())
wunlockall.setText("Unlock all")
wunlockall.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
wunlockall.setAutoRaise(True)
wunlockall.setToolTip("""<P>Click this to unlock the intensity ranges of all images.</P>""")
lo1.addWidget(wunlockall)
wlock.setChecked(self._rc.isDisplayRangeLocked())
QObject.connect(wlock, SIGNAL("clicked(bool)"), self._rc.lockDisplayRange)
QObject.connect(wlockall, SIGNAL("clicked()"),
self._currier.curry(self._imgman.lockAllDisplayRanges, self._rc))
QObject.connect(wunlockall, SIGNAL("clicked()"), self._imgman.unlockAllDisplayRanges)
QObject.connect(self._rc, SIGNAL("displayRangeLocked"), wlock.setChecked)
# self._wlock_imap_axis = [ QCheckBox(name,self) for iaxis,name,labels in sliced_axes ]
# for iw,w in enumerate(self._wlock_imap_axis):
# QObject.connect(w,SIGNAL("toggled(bool)"),self._currier.curry(self._rc.lockDisplayRangeForAxis,iw))
# lo1.addWidget(w,0)
lo1.addStretch(1)
# lo0.addWidget(Separator(self,"Colourmap"))
# color bar
self._colorbar = QwtPlot(self)
lo0.addWidget(self._colorbar)
self._colorbar.setAutoDelete(False)
self._colorbar.setMinimumHeight(32)
self._colorbar.enableAxis(QwtPlot.yLeft, False)
self._colorbar.enableAxis(QwtPlot.xBottom, False)
# color plot
self._colorplot = QwtPlot(self)
lo0.addWidget(self._colorplot)
self._colorplot.setAutoDelete(False)
self._colorplot.setMinimumHeight(64)
self._colorplot.enableAxis(QwtPlot.yLeft, False)
self._colorplot.enableAxis(QwtPlot.xBottom, False)
# self._colorplot.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Preferred)
self._colorbar.hide()
self._colorplot.hide()
# color controls
lo1 = QHBoxLayout()
lo1.setContentsMargins(0, 0, 0, 0)
lo0.addLayout(lo1, 1)
lo1.addWidget(QLabel("Colourmap:", self))
# colormap list
### NB: use setIconSize() and icons in QComboBox!!!
self._wcolmaps = QComboBox(self)
self._wcolmaps.setIconSize(QSize(128, 16))
self._wcolmaps.setToolTip("""<P>Use this to select a different colourmap.</P>""")
for cmap in self._rc.getColormapList():
self._wcolmaps.addItem(QIcon(cmap.makeQPixmap(128, 16)), cmap.name)
lo1.addWidget(self._wcolmaps)
QObject.connect(self._wcolmaps, SIGNAL("activated(int)"), self._rc.setColorMapNumber)
# add widgetstack for colormap controls
self._wcolmap_control_stack = QStackedWidget(self)
self._wcolmap_control_blank = QWidget(self._wcolmap_control_stack)
self._wcolmap_control_stack.addWidget(self._wcolmap_control_blank)
lo0.addWidget(self._wcolmap_control_stack)
self._colmap_controls = []
# add controls to stack