ManimCommunity / ManimCommunity/manim
Change NumberLine's number_scaling based on number length
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Enhancement proposal
`NumberLine` will use the same scaling regardless of the length of the number labels:
```py
class Example(Scene):
def construct(self):
axes = Axes(
x_range=[-2, 2, 0.5],
y_range=[-14, 14, 3.75],
x_length=10,
axis_config={"color": GREEN, "include_numbers": True},
tips=False,
)
self.add(axes)
```

In a previous PR @hydrobeam suggested changing `number_scale_value` based on the length of the numbers so that it doesn't get squashed for longer numbers.
## Additional comments
Contributor guide
Research direction
Start by locating NumberLine and the number_scale_value handling, then reproduce the Axes example from the issue with labels of different lengths. The work is done when NumberLine scaling adapts to label length without squashing longer numbers; add or update focused tests if the existing NumberLine test coverage is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100