本文整理汇总了Python中mobject.tex_mobject.TexMobject.shift_onto_screen方法的典型用法代码示例。如果您正苦于以下问题:Python TexMobject.shift_onto_screen方法的具体用法?Python TexMobject.shift_onto_screen怎么用?Python TexMobject.shift_onto_screen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.tex_mobject.TexMobject
的用法示例。
在下文中一共展示了TexMobject.shift_onto_screen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_graph_label
# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import shift_onto_screen [as 别名]
def get_graph_label(
self,
graph,
label = "f(x)",
x_val = None,
direction = RIGHT,
buff = MED_SMALL_BUFF,
color = None,
):
label = TexMobject(label)
color = color or graph.get_color()
label.highlight(color)
if x_val is None:
#Search from right to left
for x in np.linspace(self.x_max, self.x_min, 100):
point = self.input_to_graph_point(x, graph)
if point[1] < SPACE_HEIGHT:
break
x_val = x
label.next_to(
self.input_to_graph_point(x_val, graph),
direction,
buff = buff
)
label.shift_onto_screen()
return label
示例2: show_symbolic_sum
# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import shift_onto_screen [as 别名]
def show_symbolic_sum(self, new_array, vector):
new_mob = TexMobject([
"(%d)\\hat{\\imath}"%self.vector_coords[0],
"+",
"(%d)\\hat{\\jmath}"%self.vector_coords[1]
])
new_mob.move_to(new_array)
new_mob.shift_onto_screen()
i_hat, plus, j_hat = new_mob.split()
i_hat.highlight(X_COLOR)
j_hat.highlight(Y_COLOR)
self.play(Transform(new_array, new_mob))
self.dither()