bugGNU Octave - Bugs: bug #55876, Can not correctly set ylim...


bug #55876: Can not correctly set ylim sometimes in log plot

Submitted by:  Eddy <count>
Submitted on:  Sun 10 Mar 2019 02:56:55 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

Add a New Comment (Rich Markup)

You are not logged in

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


Sun 10 Mar 2019 09:36:50 PM UTC, comment #3: 

Thank you for the fast fix! Confirm it is working.

The changeset should be http://hg.savannah.gnu.org/hgweb/octave/rev/69722280102c

Eddy <count>
Sun 10 Mar 2019 06:01:07 PM UTC, comment #2: 

Markus' patch works fine for me.  ylim() values now stay at the values set by the programmer.  Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Sun 10 Mar 2019 05:31:34 PM UTC, comment #1: 

I pushed a patch that should fix this issue on the default branch here:

The bug occurs if both axis limits are small compared to sqrt(eps("double")) (on a linear scale).

Markus M├╝tzel <mmuetzel>
Project Member
Sun 10 Mar 2019 02:56:55 PM UTC, original submission:  

An example is:
(Octave version 5.0.91 built from source, Debian 9):

1> semilogy (logspace (-30, 1, 100))
2> ylim ([2e-27   3e-13])
3> ylim ()
ans =

   2.0000e-29   3.0000e-11

4> set (gca, 'ytick', [1e-25   1e-20]);  % slow here
5> ylim ()
ans =

   2.0000e-31   3.0000e-09

6> length (get (gca, 'yminortickvalues'))
ans =  27000287

Setting of ylim lead to different bounds, and the bounds could change due to setting of 'ytick'. Also the minor ticks after setting ytick is weird.

This happens in version 4.4.1 and 5.1.0 also, although the detailed behavior may be different. Seems no problem in version 4.0.3.

A probably related bug is: after the semilogy above, try zooming into small range using GUI (say fltk). The zoom in y direction would be "blocked" up to some scale (say 10^-16 ~ 10^-8), i.e. cannot zoom in too much.

Due to this bug, I sometimes could not workaround bug #55864 by manually setting axis ticks.

Eddy <count>


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

Attach Files:

No files currently attached


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 (Posted a comment)
  • -email is unavailable- added by count (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-10 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-03-10 mmuetzel StatusNone => Ready For Test

    Back to the top

    Powered by Savane 3.5