-
Notifications
You must be signed in to change notification settings - Fork 2.2k
NumberPlane ignoring x_axis_config and y_axis_config setting #4239
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
Comments
The image below shows the output of the NumberPlane example: from manim import *
import numpy as np
class NumberPlaneExample(Scene):
def construct(self):
number_plane = NumberPlane(
x_range=[-6, 6, 1],
y_range=[-6, 6, 1],
x_length=6,
y_length=8,
x_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
y_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
)
number_plane.add_coordinates()
self.add(number_plane) As you can see, the it doesn't respect the x or y axis config step in terms of 2 for the range -6 to 6. If I use the Axis class, it works as intended. from manim import *
class Graph2DExample(Scene):
def construct(self):
ax = Axes(
x_range=[-6, 6, 1],
y_range=[-6, 6, 1],
x_length=6,
y_length=6,
x_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
y_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
tips=False,
)
labels = ax.get_axis_labels(
x_label=Tex(r"$x$"), y_label=Tex(r"$y$")
)
self.add(ax, labels) Q01: Since the NumberPlane class inherits from Axes class, why is it ignoring the x_axis_config and y_axis_config? |
so what is the difference between your usage of the class NumberPlaneExample(Scene):
def construct(self):
number_plane = NumberPlane(
x_range=[-6, 6, 1],
y_range=[-6, 6, 1],
x_length=6,
y_length=8,
x_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
y_axis_config={"numbers_to_include": np.arange(-6, 6, 2)},
)
#number_plane.add_coordinates()
self.add(number_plane) results in this rendering: |
Thank you. I wasn't aware number_plane.add_coordinates() adds all co-ordinate values. |
Description of bug / unexpected behavior
I am trying to get the NumberPlane to display the co-ordinates in steps of 2, but the NumberPlane class ignores the x_axis_config and y_axis_config attributes inherited from the Axes base class
Expected behavior
The NumberPlane should display alternating co-ordinates.
How to reproduce the issue
Code for reproducing the problem
System specifications
System Details
pip list
):The text was updated successfully, but these errors were encountered: