本文整理汇总了Python中matplotlib.widgets.Slider.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Slider.__init__方法的具体用法?Python Slider.__init__怎么用?Python Slider.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.widgets.Slider
的用法示例。
在下文中一共展示了Slider.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""Identical to Slider.__init__, except for the "increment" kwarg.
"increment" specifies the step size that the slider will be discritized
to."""
self.inc = kwargs.pop("increment", 1.0)
Slider.__init__(self, *args, **kwargs)
self.dval = int(self.val + 0.5)
示例2: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""Identical to Slider.__init__, except for the "increment" kwarg.
"increment" specifies the step size that the slider will be discritized
to."""
self.inc = kwargs.pop('increment', 0.5)
self.discrete_val = round(kwargs['valinit'] / self.inc) * self.inc
Slider.__init__(self, *args, **kwargs)
示例3: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""
Identical to Slider.__init__, except for the "increment" kwarg.
"increment" specifies the step size that the slider will be
discretized to.
"""
self.inc = kwargs.pop('increment', 0.5)
Slider.__init__(self, *args, **kwargs)
示例4: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
"""
Identical to Slider.__init__, except for the new keyword 'allowed_vals'.
This keyword specifies the allowed positions of the slider
"""
self.allowed_vals = kwargs.pop('allowed_vals', None)
self.previous_val = kwargs['valinit']
Slider.__init__(self, *args, **kwargs)
if self.allowed_vals == None:
self.allowed_vals = [self.valmin, self.valmax]
示例5: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.inc = kwargs.pop('increment', 1.0)
self.param = kwargs.pop('param')
self.item = kwargs.pop('item')
self.val = None
Slider.__init__(self,*args, **kwargs)
self.on_changed( self.replot )
return
示例6: __init__
# 需要导入模块: from matplotlib.widgets import Slider [as 别名]
# 或者: from matplotlib.widgets.Slider import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.previous_val = kwargs['valinit']
Slider.__init__(self, *args, **kwargs)