本文整理汇总了Python中mobject.tex_mobject.TexMobject.arrange_submobjects方法的典型用法代码示例。如果您正苦于以下问题:Python TexMobject.arrange_submobjects方法的具体用法?Python TexMobject.arrange_submobjects怎么用?Python TexMobject.arrange_submobjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.tex_mobject.TexMobject
的用法示例。
在下文中一共展示了TexMobject.arrange_submobjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct
# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import arrange_submobjects [as 别名]
def construct(self):
v_color = MAROON_C
w_color = BLUE
definition = TextMobject("""
The ``span'' of $\\vec{\\textbf{v}}$ and
$\\vec{\\textbf{w}}$ is the \\\\ set of all their
linear combinations.
""")
definition.scale_to_fit_width(2*SPACE_WIDTH-1)
definition.to_edge(UP)
def_mobs = np.array(definition.split())
VMobject(*def_mobs[4:4+4]).highlight(PINK)
VMobject(*def_mobs[11:11+2]).highlight(v_color)
VMobject(*def_mobs[16:16+2]).highlight(w_color)
VMobject(*def_mobs[-19:-1]).highlight(YELLOW)
equation = TexMobject([
"a", "\\vec{\\textbf{v}}", "+", "b", "\\vec{\\textbf{w}}"
])
equation.arrange_submobjects(buff = 0.1, aligned_edge = DOWN)
equation.split()[1].highlight(v_color)
equation.split()[4].highlight(w_color)
a, b = np.array(equation.split())[[0, 3]]
equation.scale(2)
equation.next_to(definition, DOWN, buff = 1)
vary_words = TextMobject(
"Let $a$ and $b$ vary \\\\ over all real numbers"
)
vary_words.scale(1.5)
vary_words.next_to(equation, DOWN, buff = 2)
arrows = [
Arrow(vary_words, letter)
for letter in a, b
]
self.play(Write(definition))
self.play(Write(equation))
self.dither()
self.play(
FadeIn(vary_words),
ShowCreation(VMobject(*arrows))
)
self.dither()