本文整理汇总了Python中matplotlib.transforms.Affine2DBase方法的典型用法代码示例。如果您正苦于以下问题:Python transforms.Affine2DBase方法的具体用法?Python transforms.Affine2DBase怎么用?Python transforms.Affine2DBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.transforms
的用法示例。
在下文中一共展示了transforms.Affine2DBase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_transform
# 需要导入模块: from matplotlib import transforms [as 别名]
# 或者: from matplotlib.transforms import Affine2DBase [as 别名]
def generate_transform(transform_list=[]):
if len(transform_list):
output = io.StringIO()
for type, value in transform_list:
if type == u'scale' and (value == (1.0,) or value == (1.0, 1.0)):
continue
if type == u'translate' and value == (0.0, 0.0):
continue
if type == u'rotate' and value == (0.0,):
continue
if type == u'matrix' and isinstance(value, Affine2DBase):
value = value.to_values()
output.write(u'%s(%s)' % (type, ' '.join(str(x) for x in value)))
return output.getvalue()
return ''
示例2: generate_transform
# 需要导入模块: from matplotlib import transforms [as 别名]
# 或者: from matplotlib.transforms import Affine2DBase [as 别名]
def generate_transform(transform_list=[]):
if len(transform_list):
output = io.StringIO()
for type, value in transform_list:
if type == 'scale' and (value == (1.0,) or value == (1.0, 1.0)):
continue
if type == 'translate' and value == (0.0, 0.0):
continue
if type == 'rotate' and value == (0.0,):
continue
if type == 'matrix' and isinstance(value, Affine2DBase):
value = value.to_values()
output.write('%s(%s)' % (type, ' '.join(str(x) for x in value)))
return output.getvalue()
return ''
示例3: generate_transform
# 需要导入模块: from matplotlib import transforms [as 别名]
# 或者: from matplotlib.transforms import Affine2DBase [as 别名]
def generate_transform(transform_list=[]):
if len(transform_list):
output = io.StringIO()
for type, value in transform_list:
if type == 'scale' and (value == (1.0,) or value == (1.0, 1.0)):
continue
if type == 'translate' and value == (0.0, 0.0):
continue
if type == 'rotate' and value == (0.0,):
continue
if type == 'matrix' and isinstance(value, Affine2DBase):
value = value.to_values()
output.write('%s(%s)' % (
type, ' '.join(short_float_fmt(x) for x in value)))
return output.getvalue()
return ''
示例4: __init__
# 需要导入模块: from matplotlib import transforms [as 别名]
# 或者: from matplotlib.transforms import Affine2DBase [as 别名]
def __init__(self, scale_transform, limits):
"""
*limits* is the view limit of the data. The only part of
its bounds that is used is the y limits (for the radius limits).
The theta range is handled by the non-affine transform.
"""
mtransforms.Affine2DBase.__init__(self)
self._scale_transform = scale_transform
self._limits = limits
self.set_children(scale_transform, limits)
self._mtx = None
示例5: generate_transform
# 需要导入模块: from matplotlib import transforms [as 别名]
# 或者: from matplotlib.transforms import Affine2DBase [as 别名]
def generate_transform(transform_list=[]):
if len(transform_list):
output = io.StringIO()
for type, value in transform_list:
if (type == 'scale' and (value == (1,) or value == (1, 1))
or type == 'translate' and value == (0, 0)
or type == 'rotate' and value == (0,)):
continue
if type == 'matrix' and isinstance(value, Affine2DBase):
value = value.to_values()
output.write('%s(%s)' % (
type, ' '.join(short_float_fmt(x) for x in value)))
return output.getvalue()
return ''