bugGNU Octave - Bugs: bug #58228, "axis equal" for patch...


bug #58228: "axis equal" for patch objects would look better if axis limits included entire patch

Submitted by:  Muhali <muhali>
Submitted on:  Thu 23 Apr 2020 08:37:01 AM UTC  
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 29 May 2020 10:43:44 PM UTC, comment #5: 

Actually, this was an easy fix.  We had code in patch.m which was a hack around old behavior in Octave.  Removing the hack makes this code work, and doesn't seem to cause any other problems.  See changeset https://hg.savannah.gnu.org/hgweb/octave/rev/fd0789e075bf.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Fri 24 Apr 2020 04:25:02 PM UTC, comment #4: 

The Matlab documentation for the axis function doesn't make reference to choosing limits such that an entire graphics object is displayed (https://www.mathworks.com/help/matlab/ref/axis.html).  Instead, they talk about changing the aspect ratio so that each axis is measured in equivalent units.

Hence, I've changed the description and made this a "Feature Request".  It would certainly be nicer for users if Octave were to pick axis limits that included the whole patch.

As another workaround, if you don't want "tight" axis limits you can disable "auto" limits before invoking axis equal.

load foo.ot
patch (X,Y,Z)
axis manual
axis equal

The plot looks pretty good.  See attached file axis_manual_equal.png

Rik <rik5>
Project Administrator
Fri 24 Apr 2020 08:08:51 AM UTC, comment #3: 

@Rik: My figure is identical to your second, truncated figure (5.2.0). I don't think it is the intended meaning of "equal" and it is not what Matlab gives. I attach that one for comparison.

@anon: That is indeed a workaround, but while there are infinitely many ways to make the axes "equal", it should never truncate the figure.

Muhali <muhali>
Thu 23 Apr 2020 09:31:48 PM UTC, comment #2: 

Workaround: Try "axis tight" and then "axis equal". The "axis equal" command will only make the x and y scales equal but without regard to where the actual plotted area is.

Does this work better for you?

Thu 23 Apr 2020 08:47:15 PM UTC, comment #1: 

Could you take a screen snapshot and upload it?  It's not quite clear to me what effect you are seeing.

I ran the script in version 5.1.0 and 5.2.0 and uploaded the screenshots.

file octave5.1.0.axis_equal.png

file octave5.2.0.axis_equal.png

Rik <rik5>
Project Administrator
Thu 23 Apr 2020 08:37:01 AM UTC, original submission:  


load foo.ot
patch(X, Y, Z);
axis equal

with the attached file foo.ot results in a figure with both axes being truncated.

Muhali <muhali>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #48926:  axis_manual_equal.png added by rik5 (37KiB - image/png)
file #48921:  Matlab.png added by muhali (15KiB - image/png)
file #48913:  octave5.1.0.axis_equal.png added by rik5 (27KiB - image/png)
file #48914:  octave5.2.0.axis_equal.png added by rik5 (21KiB - image/png)
file #48909:  foo.ot added by muhali (1KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by muhali (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-29 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2020-04-24 rik5 Priority5 - Normal => 3 - Low
    2020-04-24 rik5 Attached File- => Added axis_manual_equal.png, #48926
        CategoryPlotting => Octave Function
        Severity3 - Normal => 1 - Wish
        Item GroupNone => Feature Request
        StatusNeed Info => Confirmed
        Release5.1.0 => dev
        Summaryaxis equal for patch truncates axes => "axis equal" for patch objects would look better if axis limits included entire patch
    2020-04-24 muhali Attached File- => Added Matlab.png, #48921
    2020-04-23 rik5 Attached File- => Added octave5.1.0.axis_equal.png, #48913
        Attached File- => Added octave5.2.0.axis_equal.png, #48914
        StatusNone => Need Info
    2020-04-23 muhali Attached File- => Added foo.ot, #48909

    Back to the top

    Powered by Savane 3.5