bugGNU Octave - Bugs: bug #49038, "axis equal" should not...

 
 

bug #49038: "axis equal" should not change aspect ratio of axes

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Fri 09 Sep 2016 04:24:01 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Sep 2016 09:11:12 PM UTC, comment #3: 

I pushed your patch.  I made one small change which was to rename the variable axisPos written in CamelCase to axis_pos.  jwe hates CamelCase.

Rik <rik5>
Group administrator
Fri 09 Sep 2016 05:13:55 PM UTC, comment #2: 

To be a little clearer: Matlab ignores it if "x/y/zlimmode" is set to "manual" and changes the property to "auto" to be able to keep the aspect ratio of the axes. The proposed patch does the same.

Markus Mützel <mmuetzel>
Group administrator
Fri 09 Sep 2016 04:31:08 PM UTC, comment #1: 

Attached the changeset.

Matlab also seems to ignore if "x/y/zlimsmode" is set to "manual" to be able to keep the aspect ratio of the axes:

>> hax = axes ();
>> image (rand (3, 10));
>> get (hax, 'xlimmode')
ans =
manual
>> get (hax, 'xlim')
ans =
    0.5000   10.5000
>> get (hax, 'ylimmode')
ans =
manual
>> get (hax, 'ylim')
ans =
    0.5000    3.5000
>> get (hax, 'DataAspectRatioMode')
ans =
auto
>> get (hax, 'DataAspectRatio')
ans =
    5.0000    1.5000    1.0000
>> get (hax, 'PlotBoxAspectRatioMode')
ans =
auto
>> get (hax, 'PlotBoxAspectRatio')
ans =
    1.0000    0.7903    0.7903
>> axis equal
>> get (hax, 'xlimmode')
ans =
manual
>> get (hax, 'xlim')
ans =
    0.5000   10.5000
>> get (hax, 'ylimmode')
ans =
auto
>> get (hax, 'ylim')
ans =
   -1.9435    5.9435
>> get (hax, 'DataAspectRatioMode')
ans =
manual
>> get (hax, 'DataAspectRatio')
ans =
     1     1     1
>> get (hax, 'PlotBoxAspectRatioMode')
ans =
manual
>> get (hax, 'PlotBoxAspectRatio')
ans =
  434.0000  342.3000  228.2000



(file #38460)

Markus Mützel <mmuetzel>
Group administrator
Fri 09 Sep 2016 04:24:01 PM UTC, original submission:  

Calling "axis equal" should adapt the spacing of x/y/zlims such that they are equal. The axes aspect ratio, size and position should not change.
Example (see also bug #49031):

hax = axes ();
image (rand (3, 10))
axis equal


I will attach a patch as soon as I have a bug number.

Markus Mützel <mmuetzel>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38460:  bug49038_axis_equal.patch added by mmuetzel (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-16 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2016-09-09 mmuetzel Attached File- Added bug49038_axis_equal.patch, #38460

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code