The question is: how to enable panning/zooming operation to be constrained to the x axis or y axis?

The Tutorial says,
[about Pam Mode] If you press 'x' or 'y' while panning, the motion will be contrained to the x or y axis, respectively
[about Zoom Mode] You can use the modifier keys 'x', 'y' or 'CONTROL' to constrain the zoom to the x axes, the y axes, or aspect ratio preserve, respectively.

I find it really works for some examples, such as
However, it currently can't work on my canvas.
Is there any special setting so as to enable the functionality?

Thanks for your guidance in advance.

<<freedom & enjoyment>>