octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61532] "Automatic limits for current axis" bu


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #61532] "Automatic limits for current axis" button doesn't respect "axis tight"
Date: Sun, 6 Feb 2022 12:46:24 -0500 (EST)

Follow-up Comment #25, bug #61532 (project octave):

@Panxto:
I used the following simple script:

## Step 1
a = rand (10, 10);
b = rand (10, 10);
plot (a(:, 1), a(:, 2), '*r');
hold on
grid on
plot (b(:, 1)+0.5, b(:, 2)+0.2, 'sg');
## Step 2
axis equal
## Step 3
axis tight


Matlab (r2020b):
* After step 1, we have a plot with unequal tick lengths but with "rounded"
axes limits
* After step 2, the tick lengths are equal and X-limits are "tight" but not
the Y-limits
* After step 3, also the Y-limits are "tight".
Then, when zooming in, the plotbox shape (aspect ratios) remain fixed. So when
a zoom rectangle is selected with a shape wider (or taller) than the plot box,
Matlab ensures that the X-axis (or Y-axis) fits the plot box width (or height)
and increases the limits of the zoom rectangle Y-size (or X-size) so that it
fits the plot box Y-axis (or X-axis).
When zoomed in, "axis tight" restores the original figure with the tight and
equal axes.
When zooming out, Matlab refuses to zoom out beyond the original plot box.

Octave-8.0.0 (with patch from comment #13):
* After steps 1 & 2, same as Matlab
* After step 3: only the x-axis is "tight" (looks like a bug).
Then, when zooming in, Octave doesn't retain the original plot box ratios but
instead accepts those of the zoom rectangle.
In that state, "axis tight" retains the new plot box size and again only makes
the X-axis "tight". The Y-axis limits are expanded beyond the original Y-data.
That looks like a bug as well, might be the same as above.
Furthermore, Octave happily zooms out beyond the original axis limits. When
zooming out too far, it sometimes isn't able to zoom back in again - maybe due
to single precision? (wild guess).

Octave-7.0.0 (from early Dec last year) behaves largely the same, be it that
"axis tight" after zooming in retores the original figure just like Matlan
does.

Just to be sure I've saved variables a and b in a mat file so one can try with
the same data.


(file #52815)
    _______________________________________________________

Additional Item Attachment:

File name: bug61532_limits_data.mat       Size:4 KB
   
<https://file.savannah.gnu.org/file/bug61532_limits_data.mat?file_id=52815>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61532>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]