3b1b / 3b1b/manim

Graphs not rendering properly

Ouverte
#1,522 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Python
Étoiles
93.8k
Forks
7.7k
Métriques de merge des PR
Métriques de PR en attente

Description

Hello, I've been recently trying out on Manimgl the code from example_scenes.py, and I've encountered that some graphs don't show up properly in the render. More concretely, there are patches of the curves that seem to be "skipped", or not rendered properly (particularly on the sine and parabolic graphs). I was't able to fix this. Below is the code and a screen recording of the graphs and the scene in question.

https://user-images.githubusercontent.com/64146682/119419163-06e7b500-bcd0-11eb-85d2-e7ae204ef5bc.mov

```
class GraphExample(Scene):
def construct(self):
self.wait(10)
axes = Axes((-3, 10), (-1, 8))
axes.add_coordinate_labels()
self.play(Write(axes, lag_ratio=0.01, run_time=1))
sin_graph = axes.get_graph(
lambda x: 2 * math.sin(x),
color=BLUE,
)
relu_graph = axes.get_graph(
lambda x: max(x, 0),
use_smoothing=False,
color=YELLOW,
)
step_graph = axes.get_graph(
lambda x: 2.0 if x > 3 else 1.0,
discontinuities=[3],
color=GREEN,
)
sin_label = axes.get_graph_label(sin_graph, "\\sin(x)")
relu_label = axes.get_graph_label(relu_graph, Text("ReLU"))
step_label = axes.get_graph_label(step_graph, Text("Step"), x=4)
self.play(
ShowCreation(sin_graph),
FadeIn(sin_label, RIGHT),
)
self.wait(2)
self.play(
ReplacementTransform(sin_graph, relu_graph),
FadeTransform(sin_label, relu_label),
)
self.wait()
self.play(
ReplacementTransform(relu_graph, step_graph),
FadeTransform(relu_label, step_label),
)
self.wait()

parabola = axes.get_graph(lambda x: 0.25 * x**2)
parabola.set_stroke(BLUE)
self.play(
FadeOut(step_graph),
FadeOut(step_label),
ShowCreation(parabola)
)
self.wait()
dot = Dot(color=RED)
dot.move_to(axes.i2gp(2, parabola))
self.play(FadeIn(dot, scale=0.5))

x_tracker = ValueTracker(2)
f_always(
dot.move_to,
lambda: axes.i2gp(x_tracker.get_value(), parabola)
)

self.play(x_tracker.animate.set_value(4), run_time=3)
self.play(x_tracker.animate.set_value(-2), run_time=3)
self.wait()
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.