Skip to content

Resetting the opacity of NumberLine numbers doesn't animate smoothly #3128

Open
@ericrowland

Description

@ericrowland

Description of bug / unexpected behavior

Create a number line with numbers. Animate a change in the opacity of the numbers, accessed with NumberLine.numbers. The opacity changes abruptly rather than smoothly.

Smooth opacity change can be obtained by putting the numbers in a VGroup, but then the axis disappears.

Expected behavior

The opacity should change smoothly without removing the axis.

How to reproduce the issue

Code for reproducing the problem
from manim import *

class numberline(Scene):
    def construct(self):

        abrupt_opacity = Tex("Opacity changes abruptly:").shift(UP)
        number_line = NumberLine(include_numbers = True)
        self.add(abrupt_opacity, number_line)
        self.wait(1)
        self.play(
            number_line.numbers.animate.set_fill(opacity = .2)
        )
        self.wait(1)
        self.remove(abrupt_opacity, number_line)

        self.wait(1)

        axis_disappers = Tex("Axis disappears:").shift(UP)
        number_line = NumberLine(include_numbers = True)
        self.add(axis_disappers, number_line)
        self.wait(1)
        self.play(
            VGroup(*number_line.numbers).animate.set_fill(opacity = .2)
        )
        self.wait(1)

Additional media files

Images/GIFs
numberline.mp4

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
PASTE HERE
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:
FFMPEG

Output of ffmpeg -version:

PASTE HERE

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    Status

    🆕 New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions