Skip to content

Added an option to rotate the numbers shown on NumberLine #2357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abdallahsoliman00
Copy link
Contributor

Motivation

The numbers on the y-axis of Axes are horizontal:
image

There is no feature to make them vertical.

Proposed changes

To make them vertical, the NumberLine class (the mobject used to create the axes) was edited where a new argument number_orientation was introduced the the __init__.

The variable number_orientation takes in the rotation in radians.

The y_axis_config argument within Axes can now include the number orientation value.

Test

Code:

class Test(Scene):
        ax = Axes(
            x_range=(0,x_max,1),
            y_range=(0,x_max+1,1),
            height=6,
            width=6,
            x_axis_config={'include_numbers': True},
            y_axis_config={
                'include_numbers': True,
                'line_to_number_direction': UP,
                'number_orientation' : -PI/2
            }
        )
        self.add(ax)

Result:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant