SetAxesRatio only visually adjusts y-axis - can we change this?

SparksMaths shared this problem 1 year ago
Solved

When using the command SetAxesRatio to smoothly change the axes ratio we only see the y-axis change.

E.g. on a new geogebra window:

SetAxesRatio[1,2] compresses the y-axis

then after going back to a 1:1 ratio

SetAxesRatio[2,1] stretches the y-axis

Is there a way to use this command to instead visually adjust the x-axis? (so we can use a script command to adjust the x-axis in a similar manner to shift-dragging it)?


For example, could an adjusted command interpret the input as follows:

SetAxesRatio[X,Y]:

If a unitary ratio is used (either X or Y is equal to 1), fix that axis with the unit value, and adjust the other one as indicated.

E.g. from standard view - SetAxesRatio[1,2] fixes x-axis and shrinks y-axis,

from standard view - SetAxesRatio[2,1] fixes y-axis and shrinks x-axis.

If neither is unitary either stay with current behaviour (change y-axis) or do an appropriate zoom adjusting both axes.

This would have advantages over the already-useful ZoomIn command, in that it maintains the position of the origin on the screen.

Comments (3)

photo
1

try


setaxesratio(1,2)

zoomin(2,(0,0))

in the script

photo
2

Please try v466

photo
1

thanks

© 2019 International GeoGebra Institute