Why does changing the axis limits after issuing AXIS EQUAL shrink the plot area?

Illustration
ishandsouza - 2020-08-07T10:04:02+00:00
Question: Why does changing the axis limits after issuing AXIS EQUAL shrink the plot area?

After issuing the following command in the MATLAB Command Window:   axis changing the axis limits of the plot using the AXIS command will cause the area of the plot in the figure to shrink.

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

When you use the AXIS EQUAL command in MATLAB, it sets the aspect ratio so that the data units are the same in every direction. This means that one unit on the x-axis is equal in length to one unit on the y-axis.

After issuing AXIS EQUAL, if you change the axis limits, MATLAB tries to maintain the equal aspect ratio. This might cause the plot area to shrink because MATLAB adjusts the plot box to keep the data units proportional in both directions.

Here's a more detailed explanation:

  1. Aspect Ratio: AXIS EQUAL makes the plot scales the same for both axes, so the plot box will adjust to fit the new limits while maintaining this ratio.

  2. Plot Box Adjustment: When you change the axis limits after setting AXIS EQUAL, MATLAB re-calculates the plot box size to ensure that the aspect ratio remains equal, which can make the plot box appear smaller.

  3. Figure Window Constraints: The figure window size and aspect ratio constraints can also play a role. If the figure window cannot accommodate the new aspect ratio without resizing, the plot area might shrink.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!