bugGNU Octave - Bugs: bug #50356, axis "square" does not...

 
 

bug #50356: axis "square" does not force square

Submitted by:  Vic Norton <vicnorton>
Submitted on:  Sun 19 Feb 2017 09:36:58 PM UTC  
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  vicnorton Open/Closed:  Closed
Release:  4.2.0 Operating System:  Mac OS

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sat 02 Feb 2019 06:28:17 AM UTC, comment #1: 

Fixed on the development branch in this cset: https://hg.savannah.gnu.org/hgweb/octave/rev/a7dfb00d5bf5.

This will be a part of the Octave 6.1 release.  To access the fix sooner download axis.m from the Mercurial development branch and replace your local copy.

Closing report.

Rik <rik5>
Project Administrator
Sun 19 Feb 2017 09:36:58 PM UTC, original submission:  

% square_bug.m  - when square does not mean square
do_plot = 3;
xrect = [0 1.5 1.5 0 0];
yrect = [0 0 2.0 2.0 0];
if do_plot
  figure(do_plot)
  clf;
  plot(xrect, yrect, "-k");
  axis([0, 1.5, 0, 2.0], "square");  % or replace "square" with "equal"
  set(gca, ...
    "xlim", [0 1.5], "ylim", [0 2.0], ...
    "xtick", [0 : 0.25 : 1.55], "ytick", [0 : 0.25 : 2.0] ...
  );
%  set(gca, "dataaspectratiomode", "manual");  % uncomment for square
  get(gca, "dataaspectratio")
  get(gca, "dataaspectratiomode")
endif
%{
1. First run of square_bug. Figure 3 opens as a square with different x
   and y scales and textual output:
     ans = dataaspectratio     = 1.5000   2.0000   1.0000
     ans = dataapsectratiomode = auto
   The image has been saved in "square_bug_1.pdf".
2. Now contract the width of Figure 3. The square turns into a rectangle.
   On running square_bug again, the same rectangular Figure 3 window
   reappears with the same rectangle in it. The textual output is also
   unchanged:
     ans = dataaspectratio     = 1.5000   2.0000   1.0000
     ans = dataapsectratiomode = auto
   The "dataaspectratio" is incorrect. The rectangular image has been
   saved in "square_bug_2.pdf".
3. Now uncomment the
     set(gca, "dataaspectratiomode", "manual");
   line and run square-bug once again. The Figure 3 window remains the
   same, but now we have a square, the listed "dataapectratio" now means
   something, and the "dataapsectratiomode" has changed to "manual":
     ans = dataaspectratio     = 1.5000   2.0000   1.0000
     ans = dataapsectratiomode = manual
   The result is shown in "square_bug_3.pdf".
4. Proposal: when axis is set to "square", "dataapsectratiomode" should
   always be "manual". This does happen when axis is set to "equal". To
   see this, change "square" to "equal", close all figure windows,
   comment out the "dataaspectratiomode", and run the same three
   experiments again. Actually, when you run the first experiment, you
   will see
     ans = dataaspectratio     = 1   1   1
     ans = dataapsectratiomode = manual
   and the relative x and y scales on the recangle will remain the same
   no matter how you manipulate the Figure 3 window.
5. The three images, square_bug_#.pdf, were produced with
      graphics_toolkit gnuplot;
      setenv GNUTERM qt;
   and
      Export to PDF
   from the gnuplot_qt Figure 3 window.
%}

Vic Norton <vicnorton>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39794:  square_bug_1.pdf added by vicnorton (5KiB - application/pdf)
file #39795:  square_bug_2.pdf added by vicnorton (5KiB - application/pdf)
file #39796:  square_bug_3.pdf added by vicnorton (5KiB - application/pdf)

 

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 vicnorton (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-02 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed
    2017-02-19 vicnorton Attached File- => Added square_bug_1.pdf, #39794
        Attached File- => Added square_bug_2.pdf, #39795
        Attached File- => Added square_bug_3.pdf, #39796

    Back to the top


    Powered by Savane 3.5