3

My vectors are going off the screen in Linear transformation scene in manimce.

enter image description here

How to move the camera back? Or alternatively scale down the number plane such that 7 is visible in the y axis?

I dont want the zoom out effect/animation, just the zoomed out camera from the start.

What I have tried(for moving the camera):

1.Set camera frame

self.camera_frame.set_width(20) Didn't work because this only works in MovingCameraScene. Mine is a LinearTransformationScene.

What I have tried(for scaling down):

1.Axes()

ax = Axes().add_coordinates()

self.add(ax)

Both the axes will be shown making a mess.See Image

2."x_max": 10

class LinearTransformationSceneExample(LinearTransformationScene):
    CONFIG = {
        "show_basis_vectors": True,
        "foreground_plane_kwargs": {
            "x_max": 10,
            "x_min": -10,
            "y_max": 10,
            "y_min": -10,
            "faded_line_ratio": 0
        },

    }

Didn't show any effect at all. Maybe because this code is for manim3b1b version and I am using manimce?

3.axis_config

According to manim documentation,

axis_config (Optional[dict]) – Arguments to be passed to NumberLine that influences both axes.

graph = Axes(
            x_range=np.array([-8, 8, 2]),
            y_range=np.array([-4, 4, 2]),
            x_length=13,
            y_length=7,
            axis_config={
                'color' : WHITE,
                'stroke_width' : 4,
                'include_numbers' : False,
                'decimal_number_config' : {
                    'num_decimal_places' : 0,
                    'include_sign' : True,
                    'color' : WHITE
                }
            },

        )

Didnt work either. No effect at all...

But this seems to work in this case in reddit but there the OP uses class scene(m.Scene):


Any help is greatly appreciated!!

Sophile
  • 287
  • 3
  • 16

1 Answers1

2

I think you can inherit the MovingCameraScene along with the LinearTransformationScene. Then you call the init. I did that and it works for me.

class Test(LinearTransformationScene, MovingCameraScene):
    def __init__(self):
        LinearTransformationScene.__init__(
            self,
            show_coordinates=True,
            leave_ghost_vectors=True,
        )

Something like this.

Then in construct method,

def construct(self):
    self.play(self.camera.frame.animate.set(width=20))
    #something else

Then you set Hope this helps!