當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。