Manim: Shift x_axis_label/y_axis_label before the animation

Created on 23 Nov 2020  Â·  8Comments  Â·  Source: ManimCommunity/manim

Description of proposed feature


Now it is not possible to shift x_axis_label/y_axis_label (e.g. below the axis) if setup_axes(animate=True) because the shift could happen only after the animation and not before

How can the new feature be used?

It could be useful when you have long texts as labels or a quadrant more filled than another to move the label of an axis before the initial animation

I propose to add two optional params to setup_axes that are the coordinates that will be passed to a shift function

If the feature is ok, I'll prepare a PR

new feature

All 8 comments

I'm not familiar with the axes mobjects, but this sounds positive in general.

What do @XorUnison @kolibril13 think?

I like the idea!
That would be a quite useful addition.
Do we actually plan to make a more proper implementation of this Graph class?
I think it would be super nice to just type self.graph.x_axis_label = ...

Hey @kolibril13 I'm glad you like the idea.

I think it would be super nice to just type self.graph.x_axis_label = ...

We already have that (self.y_axis_label_mob andself.x_axis_label_mob) but there is no way to change their position before the animation since they are instantiated during the execution of setup_axes (see manim/manim/scene/graph_scene.py)

Yup we could definitely rewrite it, but it could break the compatibility with 3b1b/manim while my initial solution has just optional parameters.

Every decision is ok for me, I'm just trying to collect all pros and cons

Backwards compatibility with 3b1b is not a priority for our project. I
think it's fine to have breaking changes in just the ond class.

Having said that, I'd suggest we start with the easy implementation and
think about s major rewrite in the future.

On Tue, Nov 24, 2020, 11:43 AM Davide Riva notifications@github.com wrote:

Hey @kolibril13 https://github.com/kolibril13 I'm glad you like the
idea.

I think it would be super nice to just type self.graph.x_axis_label = ...

We already have that (self.y_axis_label_mob and self.x_axis_label_mob)
but there is no way to change their position before the animation since
they are instantiated during the execution of setup_axes (see
manim/manim/scene/graph_scene.py)

Yup we could definitely rewrite it, but it could break the compatibility
with 3b1b/manim while my initial solution has just optional parameters.

Every decision is ok for me, I'm just trying to collect all pros and cons

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ManimCommunity/manim/issues/768#issuecomment-733099762,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAILYACE4MJ5WMWGDEC3BTLSRPPCTANCNFSM4T76CHTA
.

@leotrs ok then, I'll try to do a PR asap:)

Update: after digging up the source code, I've noticed two undocumented configs: x_label_position and y_label_position.

I think they might be enough also for shifting purposes since each shift can be applied directly to them.
If it's ok for everyone, I'm going to close the issue

We do have a dire need of more documentation :sweat_smile: I'm glad you found something that helps.

If you're interested in that rewrite in the future, all contributions are welcome!

I'll try to help as much as possible I promise :D

Thank you all, se you soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naveen521kk picture naveen521kk  Â·  5Comments

huguesdevimeux picture huguesdevimeux  Â·  4Comments

cobordism picture cobordism  Â·  5Comments

leotrs picture leotrs  Â·  5Comments

PgBiel picture PgBiel  Â·  5Comments