ManimCommunity / ManimCommunity/manim

BarChart - y-axis labels/numbers cannot be suppressed

Open
#3,027 2 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
When creating a BarChart()-mobject it is impossible to suppress the numbering on the y-axis. The numbers cannot even be removed cleanly afterwards.

## Expected behavior
I would have expected that the given options for the y-axis NumberLine() would be handled correctly, but they are not used in the initialization at all.

## How to reproduce the issue
Trying to use y_axis_config={"include_numbers": True} or y_axis_config={"include_numbers": False} doesn't make a big difference... But in the first case the labels are even created twice.

Code for reproducing the problem

```py
class histo(Scene):
def construct(self):
sample_list = [1,2,3,4,3,2,1]
num_bins=len(sample_list)
hist_list = list(np.histogram(sample_list, bins=4, density=True))
hist = BarChart(hist_list[0], bar_colors=[ORANGE],
axis_config={},
x_axis_config={"include_numbers": False},
y_axis_config={"include_numbers": True}
)
self.add(hist)
self.wait()
for i,obj in enumerate(hist.y_axis.numbers):
self.play(obj.animate.shift((0.3*i+.3)*LEFT))
self.remove(hist.y_axis.numbers[i])
self.wait(2)
```

## System specifications
Manim Community v0.16.0.post0
on Windows 10/Python 3.9.8 AND on Discord/Manimator

Contributor guide

Open the contributing guide

Research direction

Start by tracing BarChart initialization and how y_axis_config is passed to the y-axis NumberLine. Verify the reproduced cases for include_numbers set to true and false, then confirm that labels are neither duplicated nor left visible when suppression is requested.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.