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


Python TexMobject.stretch_to_fit_height方法代码示例

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


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

示例1: add_brackets

# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import stretch_to_fit_height [as 别名]
 def add_brackets(self):
     bracket_pair = TexMobject("\\big[ \\big]")
     bracket_pair.scale(2)
     bracket_pair.stretch_to_fit_height(self.get_height() + 0.5)
     l_bracket, r_bracket = bracket_pair.split()
     l_bracket.next_to(self, LEFT)
     r_bracket.next_to(self, RIGHT)
     self.add(l_bracket, r_bracket)
     self.brackets = VMobject(l_bracket, r_bracket)
     return self
开发者ID:namkam5,项目名称:manim,代码行数:12,代码来源:matrix.py

示例2: get_det_text

# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import stretch_to_fit_height [as 别名]
def get_det_text(matrix, determinant = None):
    parens = TexMobject(["(", ")"])
    parens.scale(2)
    parens.stretch_to_fit_height(matrix.get_height())
    l_paren, r_paren = parens.split()
    l_paren.next_to(matrix, LEFT, buff = 0.1)
    r_paren.next_to(matrix, RIGHT, buff = 0.1)
    det = TextMobject("det").next_to(l_paren, LEFT, buff = 0.1)
    det.add_background_rectangle()
    det_text = VMobject(det, l_paren, r_paren)
    if determinant is not None:
        eq = TexMobject("=")
        eq.next_to(r_paren, RIGHT, buff = 0.1)
        result = TexMobject(str(determinant))
        result.next_to(eq, RIGHT, buff = 0.2)
        det_text.add(eq, result)
    return det_text
开发者ID:xhrwang,项目名称:manim,代码行数:19,代码来源:chapter5.py


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