A community-maintained Python framework for creating mathematical animations.
Test graph scene
Ben Hambrecht51c61e0d0dd3
diff --git a/active_projects/eop/chapter1.py b/active_projects/eop/chapter1.pyindex 7cb6c469f..be2c5204a 100644--- a/active_projects/eop/chapter1.py+++ b/active_projects/eop/chapter1.py@@ -762,7 +762,7 @@ class IllustrateAreaModel2(AreaIsDerivative):"y_min" : -4,"num_iterations" : 7,"y_axis_label" : "",- "num_rects" : 400,+ "num_rects" : 50,"dT" : 0.25,"variable_point_label" : "T","area_opacity" : 0.8,@@ -771,6 +771,7 @@ class IllustrateAreaModel2(AreaIsDerivative):self.setup_axes()self.introduce_variable_area()+ returngraph, label = self.get_v_graph_and_label()@@ -935,6 +936,29 @@ class AreaSplitting(Scene):+class Test(GraphScene):+ CONFIG = {+ "x_min" : -3,+ "x_max" : 3,+ "y_min" : -0.2,+ "y_max" : 2,+ "graph_origin": 3*DOWN+ }++ def construct(self):++ self.setup_axes()+ graph = self.get_graph(lambda x: np.exp(-x**2/2))+ self.add(graph)++ integral = self.get_riemann_rectangles(graph,x_min = -3, x_max = 0)+ self.add(integral)++ anim = self.get_animation_integral_bounds_change(graph, new_xmin = 3, new_xmax = 2)++ self.play(anim)++