整数表

限定名称: manim.mobject.table.IntegerTable

IntegerTable(table, element_to_mobject=<class 'manim.mobject.text.numbers.Integer'>, **kwargs)[source]

基类: Table

一个专门用于 Table mobject,与 Integer 一同使用。

示例

示例: IntegerTableExample

../_images/IntegerTableExample-1.png
from manim import *

class IntegerTableExample(Scene):
    def construct(self):
        t0 = IntegerTable(
            [[0,30,45,60,90],
            [90,60,45,30,0]],
            col_labels=[
                MathTex(r"\frac{\sqrt{0}}{2}"),
                MathTex(r"\frac{\sqrt{1}}{2}"),
                MathTex(r"\frac{\sqrt{2}}{2}"),
                MathTex(r"\frac{\sqrt{3}}{2}"),
                MathTex(r"\frac{\sqrt{4}}{2}")],
            row_labels=[MathTex(r"\sin"), MathTex(r"\cos")],
            h_buff=1,
            element_to_mobject_config={"unit": r"^{\circ}"})
        self.add(t0)
class IntegerTableExample(Scene):
    def construct(self):
        t0 = IntegerTable(
            [[0,30,45,60,90],
            [90,60,45,30,0]],
            col_labels=[
                MathTex(r"\frac{\sqrt{0}}{2}"),
                MathTex(r"\frac{\sqrt{1}}{2}"),
                MathTex(r"\frac{\sqrt{2}}{2}"),
                MathTex(r"\frac{\sqrt{3}}{2}"),
                MathTex(r"\frac{\sqrt{4}}{2}")],
            row_labels=[MathTex(r"\sin"), MathTex(r"\cos")],
            h_buff=1,
            element_to_mobject_config={"unit": r"^{\circ}"})
        self.add(t0)

Table 的特例,其中 element_to_mobject 设置为 Integer。如果表中存在小数条目,则会进行四舍五入。

参数:
  • table (可迭代对象[可迭代对象[浮点数 | 字符串]]) – 一个二维数组或列表的列表。表格内容必须是 Integer 的有效输入。

  • element_to_mobject (可调用对象[[浮点数 | 字符串], VMobject]) – 应用于表格条目的 Mobject 类。设置为 Integer

  • kwargs – 传递给 Table 的额外参数。

方法

属性

animate (动画)

用于动画化 self 的任何方法的应用。

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

如果存在多种颜色(用于渐变),则返回第一种颜色

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

_original__init__(table, element_to_mobject=<class 'manim.mobject.text.numbers.Integer'>, **kwargs)

Table 的特例,其中 element_to_mobject 设置为 Integer。如果表中存在小数条目,则会进行四舍五入。

参数:
  • table (可迭代对象[可迭代对象[浮点数 | 字符串]]) – 一个二维数组或列表的列表。表格内容必须是 Integer 的有效输入。

  • element_to_mobject (可调用对象[[浮点数 | 字符串], VMobject]) – 应用于表格条目的 Mobject 类。设置为 Integer

  • kwargs – 传递给 Table 的额外参数。