当前位置: 首页>>代码示例>>Python>>正文


Python IdentityTransform._as_mpl_transform方法代码示例

本文整理汇总了Python中transforms.IdentityTransform._as_mpl_transform方法的典型用法代码示例。如果您正苦于以下问题:Python IdentityTransform._as_mpl_transform方法的具体用法?Python IdentityTransform._as_mpl_transform怎么用?Python IdentityTransform._as_mpl_transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在transforms.IdentityTransform的用法示例。


在下文中一共展示了IdentityTransform._as_mpl_transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Artist

# 需要导入模块: from transforms import IdentityTransform [as 别名]
# 或者: from transforms.IdentityTransform import _as_mpl_transform [as 别名]

#.........这里部分代码省略.........
        """
        Fire an event when property changed, calling all of the
        registered callbacks.
        """
        for oid, func in self._propobservers.iteritems():
            func(self)

    def is_transform_set(self):
        """
        Returns *True* if :class:`Artist` has a transform explicitly
        set.
        """
        return self._transformSet

    def set_transform(self, t):
        """
        Set the :class:`~matplotlib.transforms.Transform` instance
        used by this artist.

        ACCEPTS: :class:`~matplotlib.transforms.Transform` instance
        """
        self._transform = t
        self._transformSet = t is not None
        self.pchanged()

    def get_transform(self):
        """
        Return the :class:`~matplotlib.transforms.Transform`
        instance used by this artist.
        """
        if self._transform is None:
            self._transform = IdentityTransform()
        elif (not isinstance(self._transform, Transform)
              and hasattr(self._transform, '_as_mpl_transform')):
            self._transform = self._transform._as_mpl_transform(self.axes)
        return self._transform

    def hitlist(self, event):
        """
        List the children of the artist which contain the mouse event *event*.
        """
        L = []
        try:
            hascursor, info = self.contains(event)
            if hascursor:
                L.append(self)
        except:
            import traceback
            traceback.print_exc()
            print("while checking", self.__class__)

        for a in self.get_children():
            L.extend(a.hitlist(event))
        return L

    def get_children(self):
        """
        Return a list of the child :class:`Artist`s this
        :class:`Artist` contains.
        """
        return []

    def contains(self, mouseevent):
        """Test whether the artist contains the mouse event.

        Returns the truth value and a dictionary of artist specific details of
开发者ID:Xarthisius,项目名称:matplotlib,代码行数:70,代码来源:artist.py


注:本文中的transforms.IdentityTransform._as_mpl_transform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。