DecimalTable#
Qualified name: manim.mobject.table.DecimalTable
- class DecimalTable(table, element_to_mobject=<class 'manim.mobject.text.numbers.DecimalNumber'>, element_to_mobject_config={'num_decimal_places': 1}, **kwargs)[source]#
Bases:
TableA specialized
Tablemobject for use withDecimalNumberto display decimal entries.Examples
Example: DecimalTableExample ¶
from manim import * class DecimalTableExample(Scene): def construct(self): x_vals = [-2,-1,0,1,2] y_vals = np.exp(x_vals) t0 = DecimalTable( [x_vals, y_vals], row_labels=[MathTex("x"), MathTex("f(x)=e^{x}")], h_buff=1, element_to_mobject_config={"num_decimal_places": 2}) self.add(t0)
Special case of
Tablewithelement_to_mobjectset toDecimalNumber. By default,num_decimal_placesis set to 1. Will round/truncate the decimal places based on the providedelement_to_mobject_config.- Parameters
table (Iterable[Iterable[float | str]]) – A 2D array, or a list of lists. Content of the table must be valid input for
DecimalNumber.element_to_mobject (Callable[[float | str], VMobject]) – The
Mobjectclass applied to the table entries. Set asDecimalNumber.element_to_mobject_config (dict) – Element to mobject config, here set as {“num_decimal_places”: 1}.
kwargs – Additional arguments to be passed to
Table.
Methods
Attributes
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.