bugGNU Octave - Bugs: bug #31174, octave3.2: axis equal/square...

 
 

bug #31174: octave3.2: axis equal/square incorrect for gnuplot 4.4

Submitted by:  None
Submitted on:  Thu 30 Sep 2010 05:34:12 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Yann VernierOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
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.

 

(Jump to the original submission Jump to the original submission)

Tue 26 Oct 2010 03:24:59 AM UTC, comment #11:

Gnuplot works correctly with the 'wxt' terminal, but not with the 'x11'. This seems like something not worth pursuing since our focus is Octave itself. I'm closing this bug now.

Rik <rik5>
Project Administrator
Tue 26 Oct 2010 02:47:59 AM UTC, comment #10:

Gnuplot has several display terminals it uses (pm, x11, aqua, wxt, etc), and is currently unable to detect the size or position of any of them. I think it is safe to assume this won't be fixed for gnuplot.

Ben Abbott <bpabbott>
Project Member
Tue 26 Oct 2010 02:26:40 AM UTC, comment #9:

This is still a problem. I ran your updated script, but when I resize the figure window with the mouse the plots are no longer correctly sized. This is what is documented in tst_axis_stretch.png.

Rik <rik5>
Project Administrator
Tue 26 Oct 2010 02:14:00 AM UTC, comment #8:

For tst_axis.m I see the correct result for "axis square", but an incorrect result for "axis equal".

The problem is with the script. The command below ...

axis ("equal", [0, 1, -1, 1])

Is properly parsed as ...

axis equal
axis ([0, 1, -1, 1])

Setting the axis limits interferes with setting the axis equal.

I've attached a correct script, and the resulting plot.

(file #21820, file #21821)

Ben Abbott <bpabbott>
Project Member
Mon 25 Oct 2010 05:33:03 PM UTC, comment #7:

The problem seems to have been fixed for printing (which may be all that we care about). However, I can still reproduce the issue in a graphical X window.

I have attached two scripts, tst_axis.m for Octave and tst_gnuplot.m for gnuplot.

To see the behavior, run octave and then execute 'tst_axis'. This will produce two graphs which are appropriately sized. Use a mouse to change the figure window size, however, and the axes are no longer correct. Two attached screenshots of this are tst_axis_no_stretch.png and tst_axis_stretch.png.

The equivalent script for gnuplot can be run be invoking gnuplot and typing 'load "tst_gnuplot.m"'. Using a mouse to change the window size doesn't affect the axis square and axis equal properties. The attached screenshots are tst_axis_gnuplot_no_stretch.png and tst_axis_gnuplot_stretch.png

(file #21812, file #21813, file #21814, file #21815)

Rik <rik5>
Project Administrator
Mon 25 Oct 2010 02:50:31 PM UTC, comment #6:

I think this has been fixed in the developers sources. For those interested running the demo to see for themselves ...

demo ("axis", 1)

I've attached a plot for gnuplot-4.4 as well as for the fltk backend.

(file #21809, file #21810)

Ben Abbott <bpabbott>
Project Member
Mon 04 Oct 2010 01:21:20 PM UTC, comment #5:

I just never updated the gnuplot example after altering the ranges to clarify the difference between data and axis ranges.
I'm not certain if Matlab uses plot size or data size for axis square, so I'm not sure if the gnuplot style (plot region square) or octave style (data square) is correct there.
For axis equal the result should be the same, with any given distance along the X axis matching precisely the distance along the Y axis.
The change from 2 units wide and 1 unit high (in gnuplot) to 1 unit wide and 2 units high (in octave) was to highlight in the axis square plot that the axis (thus whole plot region) didn't go square at all, but it's possible the Matlab convention is that only the data does. The shape of the same region (0:1,0:1) for axis equal plots should match precisely.
Feel free to alter the gnuplot script too, I merely forgot about it.

Anonymous
Sun 03 Oct 2010 02:18:38 AM UTC, comment #4:

Sorry, I missed the attachment.

I agree that there are some problems with axis equal/square, but I don't fully understand your example. In the gnuplot script you attached, you have xrange set to [-1:1] and yrange set to [0:1] but in the Octave code you have the axes set to [0,1,-1,1], which I think means the x range is 0:1 and the y range is -1:1. Was that intentional? I don't understand what you are trying to compare.

(file #21600)

John W. Eaton <jwe>
Project Administrator
Sat 02 Oct 2010 12:55:55 AM UTC, comment #3:

A script showing the problem, and example broken and functional output, were already attached.

Anonymous
Fri 01 Oct 2010 08:00:17 PM UTC, comment #2:

Or, if you want someone to check for you, please post a complete example script that shows the problem.

John W. Eaton <jwe>
Project Administrator
Fri 01 Oct 2010 06:21:23 PM UTC, comment #1:

Could you please try and replicate your bug using the latest source from the Mercurial archives? (http://www.gnu.org/software/octave/download.html) The plotting backends have undergone a lot of change since 3.2.4. In particular, the FIXME line you cite is no longer in the code which leads me to believe this issue has been addressed.

Rik <rik5>
Project Administrator
Thu 30 Sep 2010 05:34:12 PM UTC, original submission:

There is a bug in handling of 2d plots with Octave 3.2 and Gnuplot 4.4.

I found that while axis equal or axis square change the plot, both
on screen and in print, it does not calculate the ratios correctly.
Whatever it is setting seems dependent on the window shape, which really
should never affect the printout.

Forcing _gnuplot_has_feature_("screen_coordinates_for_{lrtb}margin")
to 0 fixes this problem. That variable appears to be intended to handle
some change in gnuplot 4.3, which I am not aware of.
Within _go_draw_axes_ that variable affects not only margin
calculation but disables setting of gnuplot parameters origin and size.
The variable also affects the axis command itself, as dataaspectratio
seems to change format.

"axis equal" and "axis square" should be equivalent to gnuplot "set size
ratio -1" and "set size ratio 1" respectively.

Additionally, there seems to be a developer note about this in
_go_draw_axes_:
## FIXME -- nothing should change for gnuplot 4.2.x.
Whoever wrote that probably has a better idea than I what's going on.

Debian bug #598059.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21821:  tst_axis-corrected.pdf added by bpabbott (4KiB - application/pdf)
file #21812:  tst_axis.m added by rik5 (233B - application/octet-stream)
file #21813:  tst_gnuplot.m added by rik5 (441B - application/octet-stream)
file #21814:  tst_axis_no_stretch.png added by rik5 (6KiB - image/png)
file #21815:  tst_axis_stretch.png added by rik5 (5KiB - image/png)
file #21809:  fltk.pdf added by bpabbott (22KiB - application/pdf)
file #21810:  gnuplot-4.4.pdf added by bpabbott (16KiB - application/pdf)
file #21600:  graph.png added by jwe (3KiB - image/png)
file #21582:  screenshot.png added by None (98KiB - image/png)
file #21583:  message.txt added by None (983B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 26 Oct 2010 03:24:59 AM UTCrik5StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Tue 26 Oct 2010 02:14:00 AM UTCbpabbottAttached File-=>Added tst_axis_corrected.m, #21820
      Attached File-=>Added tst_axis-corrected.pdf, #21821
    Mon 25 Oct 2010 05:33:46 PM UTCrik5Attached File-=>Added tst_axis_gnuplot_no_stretch.png, #21816
      Attached File-=>Added tst_axis_gnuplot_stretch.png, #21817
    Mon 25 Oct 2010 05:33:03 PM UTCrik5Attached File-=>Added tst_axis.m, #21812
      Attached File-=>Added tst_gnuplot.m, #21813
      Attached File-=>Added tst_axis_no_stretch.png, #21814
      Attached File-=>Added tst_axis_stretch.png, #21815
      StatusFixed=>In Progress
    Mon 25 Oct 2010 02:50:31 PM UTCbpabbottAttached File-=>Added fltk.pdf, #21809
      Attached File-=>Added gnuplot-4.4.pdf, #21810
      StatusNeed Info=>Fixed
    Sun 03 Oct 2010 02:18:38 AM UTCjweAttached File-=>Added graph.png, #21600
    Fri 01 Oct 2010 06:21:23 PM UTCrik5StatusNone=>Need Info
    Thu 30 Sep 2010 05:34:12 PM UTCNoneAttached File-=>Added screenshot.png, #21582
      Attached File-=>Added message.txt, #21583

    Back to the top


    Powered by Savane 3.1-cleanup1