本文整理汇总了Python中mobject.tex_mobject.TexMobject.remove方法的典型用法代码示例。如果您正苦于以下问题:Python TexMobject.remove方法的具体用法?Python TexMobject.remove怎么用?Python TexMobject.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.tex_mobject.TexMobject
的用法示例。
在下文中一共展示了TexMobject.remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_natural_loggedness
# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import remove [as 别名]
def show_natural_loggedness(self, expression):
base, constant = expression[1], expression[-3]
log_constant, exp_constant = constant.copy(), constant.copy()
log_base, exp_base = base.copy(), base.copy()
log_equals, exp_equals = map(TexMobject, "==")
ln = TexMobject("\\ln(2)")
log_base.move_to(ln[-2])
ln.remove(ln[-2])
log_equals.next_to(ln, LEFT)
log_constant.next_to(log_equals, LEFT)
log_expression = VGroup(
ln, log_constant, log_equals, log_base
)
e = TexMobject("e")
exp_constant.scale(0.7)
exp_constant.next_to(e, UP+RIGHT, buff = 0)
exp_base.next_to(exp_equals, RIGHT)
VGroup(exp_base, exp_equals).next_to(
VGroup(e, exp_constant), RIGHT,
aligned_edge = DOWN
)
exp_expression = VGroup(
e, exp_constant, exp_equals, exp_base
)
for group, vect in (log_expression, UP), (exp_expression, DOWN):
group.to_edge(RIGHT)
group.shift(vect)
self.play(
ReplacementTransform(base.copy(), log_base),
ReplacementTransform(constant.copy(), log_constant),
run_time = 2
)
self.play(Write(ln), Write(log_equals))
self.dither()
self.play(
ReplacementTransform(
log_expression.copy(),
exp_expression,
run_time = 2,
)
)
self.dither(2)
ln_a = expression[-1]
self.play(
FadeOut(expression[-2]),
FadeOut(constant),
ln_a.move_to, constant, LEFT,
ln_a.highlight, BLUE
)
self.dither()
self.play(*map(FadeOut, [log_expression, exp_expression]))
self.dither()