[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50356] axis "square" does not force square
From: |
Vic Norton |
Subject: |
[Octave-bug-tracker] [bug #50356] axis "square" does not force square |
Date: |
Sun, 19 Feb 2017 16:36:59 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?50356>
Summary: axis "square" does not force square
Project: GNU Octave
Submitted by: 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: None
Assigned to: None
Originator Name: vicnorton
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.0
Operating System: Mac OS
_______________________________________________________
Details:
% 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.
%}
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 19 Feb 2017 09:36:58 PM UTC Name: square_bug_1.pdf Size: 5kB By:
vicnorton
<http://savannah.gnu.org/bugs/download.php?file_id=39794>
-------------------------------------------------------
Date: Sun 19 Feb 2017 09:36:58 PM UTC Name: square_bug_2.pdf Size: 5kB By:
vicnorton
<http://savannah.gnu.org/bugs/download.php?file_id=39795>
-------------------------------------------------------
Date: Sun 19 Feb 2017 09:36:58 PM UTC Name: square_bug_3.pdf Size: 5kB By:
vicnorton
<http://savannah.gnu.org/bugs/download.php?file_id=39796>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50356>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #50356] axis "square" does not force square,
Vic Norton <=