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


Python transforms.Affine2DBase方法代码示例

本文整理汇总了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 '' 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:18,代码来源:backend_svg.py

示例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 '' 
开发者ID:miloharper,项目名称:neural-network-animation,代码行数:18,代码来源:backend_svg.py

示例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 '' 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:19,代码来源:backend_svg.py

示例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 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:13,代码来源:polar.py

示例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 '' 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:16,代码来源:backend_svg.py


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