本文整理汇总了Python中matplotlib.offsetbox.DraggableOffsetBox类的典型用法代码示例。如果您正苦于以下问题:Python DraggableOffsetBox类的具体用法?Python DraggableOffsetBox怎么用?Python DraggableOffsetBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DraggableOffsetBox类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, legend, use_blit=False, update="loc"):
"""
Wrapper around a `.Legend` to support mouse dragging.
Parameters
----------
legend : `.Legend`
The `.Legend` instance to wrap.
use_blit : bool, optional
Use blitting for faster image composition. For details see
:ref:`func-animation`.
update : {'loc', 'bbox'}, optional
If "loc", update the *loc* parameter of the legend upon finalizing.
If "bbox", update the *bbox_to_anchor* parameter.
"""
self.legend = legend
if update in ["loc", "bbox"]:
self._update = update
else:
raise ValueError("update parameter '%s' is not supported." %
update)
DraggableOffsetBox.__init__(self, legend, legend._legend_box,
use_blit=use_blit)
示例2: __init__
def __init__(self, legend, use_blit=False, update="loc"):
"""
update : If "loc", update *loc* parameter of
legend upon finalizing. If "bbox", update
*bbox_to_anchor* parameter.
"""
self.legend = legend
if update in ["loc", "bbox"]:
self._update = update
else:
raise ValueError("update parameter '%s' is not supported." % update)
DraggableOffsetBox.__init__(self, legend, legend._legend_box, use_blit=use_blit)