本文整理匯總了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