本文整理汇总了Python中matplotlib.rcsetup.validate_stringlist方法的典型用法代码示例。如果您正苦于以下问题:Python rcsetup.validate_stringlist方法的具体用法?Python rcsetup.validate_stringlist怎么用?Python rcsetup.validate_stringlist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.rcsetup
的用法示例。
在下文中一共展示了rcsetup.validate_stringlist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_keymap
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_stringlist [as 别名]
def update_keymap(self, name, *keys):
"""
Set the keymap to associate with the specified tool.
Parameters
----------
name : string
Name of the Tool
keys : keys to associate with the Tool
"""
if name not in self._tools:
raise KeyError('%s not in Tools' % name)
self._remove_keys(name)
for key in keys:
for k in validate_stringlist(key):
if k in self._keys:
cbook._warn_external('Key %s changed from %s to %s' %
(k, self._keys[k], name))
self._keys[k] = name
示例2: update_keymap
# 需要导入模块: from matplotlib import rcsetup [as 别名]
# 或者: from matplotlib.rcsetup import validate_stringlist [as 别名]
def update_keymap(self, name, *keys):
"""
Set the keymap to associate with the specified tool
Parameters
----------
name : string
Name of the Tool
keys : keys to associate with the Tool
"""
if name not in self._tools:
raise KeyError('%s not in Tools' % name)
self._remove_keys(name)
for key in keys:
for k in validate_stringlist(key):
if k in self._keys:
warnings.warn('Key %s changed from %s to %s' %
(k, self._keys[k], name))
self._keys[k] = name