ManimCommunity / ManimCommunity/manim

Change NumberLine's number_scaling based on number length

Open
#1,683 1 comment 0 reactions 0 assignees View on GitHub
enhancement
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)
```

![image](https://user-images.githubusercontent.com/32387857/121806025-e7e0a100-cc45-11eb-9d38-a0f33b059c94.png)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.