本文整理汇总了Python中silx.gui.plot.PlotWidget.clearMarkers方法的典型用法代码示例。如果您正苦于以下问题:Python PlotWidget.clearMarkers方法的具体用法?Python PlotWidget.clearMarkers怎么用?Python PlotWidget.clearMarkers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类silx.gui.plot.PlotWidget
的用法示例。
在下文中一共展示了PlotWidget.clearMarkers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ColormapDialog
# 需要导入模块: from silx.gui.plot import PlotWidget [as 别名]
# 或者: from silx.gui.plot.PlotWidget import clearMarkers [as 别名]
#.........这里部分代码省略.........
self.c.sigPlotSignal.connect(self.chval)
# colormap window can not be resized
self.setFixedSize(vlayout.minimumSize())
def plotHistogram(self, data=None):
if data is not None:
self.histogramData = data
if self.histogramData is None:
return False
bins, counts = self.histogramData
self.c.addCurve(bins, counts,
"Histogram",
color='darkYellow',
histogram='center',
yaxis='right',
fill=True)
def _update(self):
_logger.debug("colormap _update called")
self.marge = (abs(self.dataMax) + abs(self.dataMin)) / 6.0
self.minmd = self.dataMin - self.marge
self.maxpd = self.dataMax + self.marge
self.c.setGraphXLimits(self.minmd, self.maxpd)
self.c.setGraphYLimits( -11.5, 11.5)
self.__x = [self.minmd, self.dataMin, self.dataMax, self.maxpd]
self.__y = [-10, -10, 10, 10]
self.c.addCurve(self.__x, self.__y,
legend="ConstrainedCurve",
color='black',
symbol='o',
linestyle='-')
self.c.clearMarkers()
for i in range(4):
if i in [1, 2]:
draggable = True
color = "blue"
else:
draggable = False
color = "black"
key = self.markers[i][0]
label = self.markers[i][1]
self.c.addXMarker(self.__x[i],
legend=key,
text=label,
draggable=draggable,
color=color)
self.sendColormap()
def buttonGroupChange(self, val):
_logger.debug("buttonGroup asking to update colormap")
self.setColormapType(val, update=True)
self._update()
def setColormapType(self, val, update=False):
self.colormapType = val
if self.colormapType == 1:
self.buttonGroup.button(1).setChecked(True)
elif self.colormapType == 2:
self.buttonGroup.button(2).setChecked(True)
else:
self.colormapType = 0
self.buttonGroup.button(0).setChecked(True)
if update:
self._update()