Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fix: `get_riemann_rectangles` now uses the graphs range instead of the axes range (#1776)

LED Me Explain97adfc3f5a53
diff --git a/manim/mobject/coordinate_systems.py b/manim/mobject/coordinate_systems.py
index a5ae1f45e..406baa4cf 100644
--- a/manim/mobject/coordinate_systems.py
+++ b/manim/mobject/coordinate_systems.py
@@ -607,7 +607,12 @@ class CoordinateSystem:
# setting up x_range, overwrite user's third input
if x_range is None:
- x_range = self.x_range
+ if bounded_graph is None:
+ x_range = [graph.t_min, graph.t_max]
+ else:
+ x_min = max(graph.t_min, bounded_graph.t_min)
+ x_max = min(graph.t_max, bounded_graph.t_max)
+ x_range = [x_min, x_max]
x_range = [*x_range[:2], dx]