ManimCommunity / ManimCommunity/manim

`unit_size` does not work in Axes

Open
#2,336 3 comments 0 reactions 0 assignees View on GitHub
issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

The **Axes** class does not respect the `"unit_size"` setting with the `x_axis_config` or `y_axis_config` parameter.

## Expected behavior

If you change **Axes** to **NumberPlane** then it solves:

```python
class Test1(Scene):
def construct(self):
axes = NumberPlane(
x_range=[-3,3,1],
y_range=[-6,6,2],
x_axis_config={
"unit_size": 1
},
y_axis_config={
"unit_size": 0.5
}
)
self.add(axes)
```

![image](https://user-images.githubusercontent.com/43224662/143738186-8fe744bf-4de0-41b2-b396-277f4f85eb01.png)

## How to reproduce the issue
```python
class AxesBug(Scene):
def construct(self):
axes = Axes(
x_range=[-3,3,1],
y_range=[-6,6,2],
x_axis_config={
"unit_size": 1
},
y_axis_config={
"unit_size": 0.5
}
)
self.add(axes)
```
![image](https://user-images.githubusercontent.com/43224662/143736865-eadd91fd-c4b6-4daa-a8fc-2fdd82032cbe.png)

## My specs.

Manim 0.12, tested on MacOS M1 Big Sur and Linux Mint 20.1

Contributor guide

Open the contributing guide

Research direction

Start with the Axes and NumberPlane entry points and reproduce the example using x_axis_config and y_axis_config with unit_size. Compare how the two classes handle these settings, then verify that Axes respects the requested x- and y-axis unit sizes in the same example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.