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


Python texmanager.TexManager方法代码示例

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


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

示例1: get_label_width

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_label_width(self, lev, fmt, fsize):
        """
        Return the width of the label in points.
        """
        if not cbook.is_string_like(lev):
            lev = self.get_text(lev, fmt)

        lev, ismath = text.Text.is_math_text(lev)
        if ismath == 'TeX':
            if not hasattr(self, '_TeX_manager'):
                self._TeX_manager = texmanager.TexManager()
            lw, _, _ = self._TeX_manager.get_text_width_height_descent(lev,
                                                                       fsize)
        elif ismath:
            if not hasattr(self, '_mathtext_parser'):
                self._mathtext_parser = mathtext.MathTextParser('bitmap')
            img, _ = self._mathtext_parser.parse(lev, dpi=72,
                                                 prop=self.labelFontProps)
            lw = img.get_width()  # at dpi=72, the units are PostScript points
        else:
            # width is much less than "font size"
            lw = (len(lev)) * fsize * 0.6

        return lw 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:26,代码来源:contour.py

示例2: get_label_width

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_label_width(self, lev, fmt, fsize):
        """
        Return the width of the label in points.
        """
        if not isinstance(lev, str):
            lev = self.get_text(lev, fmt)

        lev, ismath = text.Text.is_math_text(lev)
        if ismath == 'TeX':
            if not hasattr(self, '_TeX_manager'):
                self._TeX_manager = texmanager.TexManager()
            lw, _, _ = self._TeX_manager.get_text_width_height_descent(lev,
                                                                       fsize)
        elif ismath:
            if not hasattr(self, '_mathtext_parser'):
                self._mathtext_parser = mathtext.MathTextParser('bitmap')
            img, _ = self._mathtext_parser.parse(lev, dpi=72,
                                                 prop=self.labelFontProps)
            lw = img.get_width()  # at dpi=72, the units are PostScript points
        else:
            # width is much less than "font size"
            lw = (len(lev)) * fsize * 0.6

        return lw 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:26,代码来源:contour.py

示例3: get_label_width

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_label_width(self, lev, fmt, fsize):
        """
        Return the width of the label in points.
        """
        if not isinstance(lev, str):
            lev = self.get_text(lev, fmt)

        lev, ismath = text.Text()._preprocess_math(lev)
        if ismath == 'TeX':
            if not hasattr(self, '_TeX_manager'):
                self._TeX_manager = texmanager.TexManager()
            lw, _, _ = self._TeX_manager.get_text_width_height_descent(lev,
                                                                       fsize)
        elif ismath:
            if not hasattr(self, '_mathtext_parser'):
                self._mathtext_parser = mathtext.MathTextParser('bitmap')
            img, _ = self._mathtext_parser.parse(lev, dpi=72,
                                                 prop=self.labelFontProps)
            lw = img.get_width()  # at dpi=72, the units are PostScript points
        else:
            # width is much less than "font size"
            lw = (len(lev)) * fsize * 0.6

        return lw 
开发者ID:boris-kz,项目名称:CogAlg,代码行数:26,代码来源:contour.py

示例4: get_label_width

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_label_width(self, lev, fmt, fsize):
        """
        Return the width of the label in points.
        """
        if not isinstance(lev, six.string_types):
            lev = self.get_text(lev, fmt)

        lev, ismath = text.Text.is_math_text(lev)
        if ismath == 'TeX':
            if not hasattr(self, '_TeX_manager'):
                self._TeX_manager = texmanager.TexManager()
            lw, _, _ = self._TeX_manager.get_text_width_height_descent(lev,
                                                                       fsize)
        elif ismath:
            if not hasattr(self, '_mathtext_parser'):
                self._mathtext_parser = mathtext.MathTextParser('bitmap')
            img, _ = self._mathtext_parser.parse(lev, dpi=72,
                                                 prop=self.labelFontProps)
            lw = img.get_width()  # at dpi=72, the units are PostScript points
        else:
            # width is much less than "font size"
            lw = (len(lev)) * fsize * 0.6

        return lw 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:26,代码来源:contour.py

示例5: get_texmanager

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_texmanager(self):
        """
        return the :class:`matplotlib.texmanager.TexManager` instance
        """
        if self._texmanager is None:
            from matplotlib.texmanager import TexManager
            self._texmanager = TexManager()
        return self._texmanager 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:10,代码来源:backend_bases.py

示例6: get_texmanager

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_texmanager(self):
        """Return the `.TexManager` instance."""
        if self._texmanager is None:
            from matplotlib.texmanager import TexManager
            self._texmanager = TexManager()
        return self._texmanager 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:8,代码来源:backend_bases.py

示例7: test_fontconfig_preamble

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def test_fontconfig_preamble():
    """
    Test that the preamble is included in _fontconfig
    """
    plt.rcParams['text.usetex'] = True

    tm1 = TexManager()
    font_config1 = tm1.get_font_config()

    plt.rcParams['text.latex.preamble'] = ['\\usepackage{txfonts}']
    tm2 = TexManager()
    font_config2 = tm2.get_font_config()

    assert font_config1 != font_config2 
开发者ID:holzschu,项目名称:python3_ios,代码行数:16,代码来源:test_texmanager.py

示例8: get_texmanager

# 需要导入模块: from matplotlib import texmanager [as 别名]
# 或者: from matplotlib.texmanager import TexManager [as 别名]
def get_texmanager(self):
        """Return the cached `~.texmanager.TexManager` instance."""
        if self._texmanager is None:
            from matplotlib.texmanager import TexManager
            self._texmanager = TexManager()
        return self._texmanager 
开发者ID:boris-kz,项目名称:CogAlg,代码行数:8,代码来源:textpath.py


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