From 0d046a7eab8c5272a40fd14a656b34abc90caed7 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 6 Nov 2023 12:32:27 -0500 Subject: [PATCH] Add an option for a graph to continually update to its defining function --- manimlib/mobject/coordinate_systems.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py index 1c4429f2..1acde16f 100644 --- a/manimlib/mobject/coordinate_systems.py +++ b/manimlib/mobject/coordinate_systems.py @@ -175,6 +175,7 @@ class CoordinateSystem(ABC): self, function: Callable[[float], float], x_range: Sequence[float] | None = None, + bind: bool = False, **kwargs ) -> ParametricCurve: x_range = x_range or self.x_range @@ -195,6 +196,10 @@ class CoordinateSystem(ABC): ) graph.underlying_function = function graph.x_range = x_range + + if bind: + self.bind_graph_to_func(graph, function) + return graph def get_parametric_curve(