Open ReneTC opened 3 weeks ago
Just to highlight part of the problem, the following code referencing the always_redraw
n number plane in the updater for the plotted curve does not work - the number plane scales as expected, but the curve is not replotted according to the new scale.
class Test(Scene):
def construct(self):
x_max = ValueTracker(5)
plane = always_redraw(lambda:
NumberPlane(
x_range = (0, 7),
y_range = (0, x_max.get_value()),
x_length = 7,
y_length = 5,
axis_config={"include_numbers": True},
)
)
line_graph = always_redraw(lambda:
plane.plot_line_graph(
x_values = [0, 1.5, 2, 2.8, 4, 6.25],
y_values = [1, 3, 2.25, 4, 2.5, 1.75],
line_color=WHITE,
vertex_dot_style=dict(stroke_width=3, fill_color=WHITE),
stroke_width = 4,
)
)
self.add(plane)
self.add(line_graph)
self.wait()
self.play(x_max.animate.set_value(2), run_time=1)
self.wait()
Description of proposed feature
I think it would be usefull to be able to something like:
to be able to animate a new axis. It's kinda like zooming in. Currently we must do something like:
This was made by the brilliant Uwezi on the discord forum here.
result:
https://github.com/ManimCommunity/manim/assets/40211569/624c5308-dd95-436c-9e83-46ef83a03325
I also think
NumberPlane
should crop the lines automatically, when going out of the numberPLane