本文整理汇总了Python中line.Line.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Line.__init__方法的具体用法?Python Line.__init__怎么用?Python Line.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类line.Line
的用法示例。
在下文中一共展示了Line.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import __init__ [as 别名]
def __init__(self, canvas, plot, orientation='horizontal', inside='up', scaling='linear', logBase=10, **kwprops):
# Need to define the label before init'ing the Line. This is because we
# override Line.setOrigin to include the label, but setOrigin is called
# in Line.__init__.
self._label = Text(canvas)
kwprops.update(aliased=True)
Line.__init__(self, canvas, **kwprops)
# Make this the parent of the label, for when they need to be cleared from the screen
self.addChild(self._label)
self._plot = plot
#######
# Set default location values
#######
self.setOrigin(0.0, 0.0)
# plotStart, plotEnd are start and end position, in plot coordinates. if horizontal,
# these are x coordinates, if vertical, y coordinates.
# plotAnchor is the opposite; if horizontal, it is the y coordinate that the axis is
# located at.
# plotLength = plotEnd - plotStart
self._plotAnchor = 0.0
self._plotStart = 0.0
self._plotEnd = 0.0
self._plotLength = 0.0
# dataStart, dataEnd are the start and end position, in data coordinates.
# dataLength = dataEnd - dataStart
self._dataStart = 0.0
self._dataEnd = 0.0
self._dataLength = 0.0
self._autoscaled = True # holds whether this Axis is currently being autoscaled to the data
# Setup the major and minor ticks
self._majorTicks = Ticks(self.canvas(), self, 'major', labeler=FormatLabeler())
self._minorTicks = Ticks(self.canvas(), self, 'minor', labeler=NullLabeler())
self._minorTicks.setLocator(num=3)
self._minorTicks.setLength(3)
self._minorTicks._labelProps.update(visible=False)
# Make this the parent of the ticks, for when they need to be cleared from the screen
self.addChild(self._majorTicks)
self.addChild(self._minorTicks)
self._slavedTo = None # pointer to this Axis' master
self._masterOf = [] # list of pointers to this Axis' slaves
# 'up' or 'down'
self._inside = None
self.setInside(inside)
# 'horizontal' or 'vertical'
self._orientation = None
self.setOrientation(orientation)
# Scaling value. Can be 'linear', 'log', or 'symlog'
self._scaling = None
self._logBase = 10
self.setScaling(scaling, logBase=logBase)