ManimCommunity / ManimCommunity/manim
get_axis_labels() not working properly for rotated axis
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
get_axis_labels() is the function needed to add labels to the axes. It is not working properly when I rotated the axis.
This problem is especially prominent for:
1. Rotations not integer multiple of PI/2
2. Axis that has only positive direction
## Expected behavior
The labels should be near the tips of each axis.
## How to reproduce the issue
Case 1
```py
class GetAxisLabelsExample(Scene):
def construct(self):
ax = Axes(x_length=4, y_length=4).rotate(0.5*PI/2)
labels = ax.get_axis_labels(Tex("x"), Text("y"))
self.add(ax, labels)
```
Case 2
```py
class GetAxisLabelsExample(Scene):
def construct(self):
ax = Axes(x_length=4, y_length=4, x_range=[0, 12]).rotate(2*PI/2)
labels = ax.get_axis_labels(Tex("x"), Text("y"))
self.add(ax, labels)
```
## Additional media files
Case 1

Case 2

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Axes.get_axis_labels and run the two Python reproductions in the issue, comparing label placement after rotation and with x_range=[0, 12]. Done means both labels are positioned near their axis tips for arbitrary rotations and axes with only positive direction.
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
- 38/100