bugGNU Octave - Bugs: bug #39449, log axis minorticks incorrect if...


bug #39449: log axis minorticks incorrect if axis limit exceeds 8 orders of magnitude

Submitted by:  None
Submitted on:  Tue 09 Jul 2013 01:50:24 PM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  ikossev Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * Microsoft Windows
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Wed 30 Apr 2014 03:25:59 PM UTC, comment #4: 

I fixed the log axis tick problem on the development branch with this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/ec55f6870efb).  It will be a part of the 4.2 release of Octave, or you can build from Mercurial sources to see the fix sooner.

Rik <rik5>
Project Administrator
Fri 12 Jul 2013 02:36:33 PM UTC, comment #3: 

Many thanks for the workaround and for updating the report title. Without the workaround I get the same result when using "gnuplot" instead of "FLTK" as a graphics_toolkit.

I tried the example

x = 10.^[0:8];
y = 1:numel (x);
semilogx (x, y);
set (gca, "xminorgrid", "on");

and get the correct plot in "gnuplot" and incorrect in "FLTK".

In "FLTK" the minor tics are available but are incorrect. The x major tics are at 1e+0, 1e+2, 1e+4, 1e+6, 1e+8. The 8 xminor tics between two adjacent orders of magnitude (e.g. 1e+2 and 1e+3) are distributed between two adjacent xmajor tics (e.g. 1e+2 and 1e+4). So seems to be also another problem.

For more than 9 orders of magnitude both "gnuplot" and "FLTK" produce incorrect plots.

Wed 10 Jul 2013 09:26:56 PM UTC, comment #2: 

Re-titling this bug to be clear about the problem.  Simple sample code to reproduce the problem is:

x = 10.^[0:8];
y = 1:numel (x);
semilogx (x, y);
set (gca, "xminorgrid", "on");

The displayed plot will not have a grid from 1e0 to 1e1, but will from 1e1 to 1e2, won't from 1e2 to 1e3, and will from 1e3 to 1e4, etc.

The problem occurs whenever there are greater than 8 orders of magnituted for the axis limit.  In the above example, xlim ([1,1e7]), causes the axis to display correctly.

This is only a problem with the FLTK backend.

Rik <rik5>
Project Administrator
Wed 10 Jul 2013 09:17:09 PM UTC, comment #1: 

Confirmed on a recent tip.  The problem occurs whenever the axis limits exceed 8 orders of magnitude.  As a short workaround for the bug reporter try

xlim ([1e-7, 1e0])

Rik <rik5>
Project Administrator
Tue 09 Jul 2013 01:50:24 PM UTC, original submission:  

In the plot I obtain from semilogx the minor ticks are incorrect.

The script ('octave_drag_coefficient_sphere.m') I use is attached to the report. I run the script manually in the octave console (see below or attached image "run_script_octave_command_line.png"):

octave:195> octave_drag_coefficient_sphere

- expected result: in the plot minor and major tics on the x axis are plotted correctly (e.g. there are nine minor tics between every two adjacent exponents of 10, e.g. 1.0e-7 and 1.0e-6).

- observed result: The major tics are shown only for the even exponents of 10 (e.g. 1.0e-6, 1.0e-4, etc.) and there are nine minor tics between every two adjacent major tics. This behaviour does not seem to be correct (see attached image "Output_nominal_v3.6.4.png")


Tried to use

'xtick', [1.0e-7 1.0e-6 1.0e-5 1.0e-4 1.0e-3 1.0e-2 1.0e-1 1.0 10.0],




'xtickmode', 'manual',

but this does not lead to the desired correct display of the minor tics (see attached images "Output_uncommented_line*.png")

Tried with octave v3.2.4 for Windows and only when line 82, 83 and 87 are commented out, then the plot is correct (see attached image "Output_nominal_v3.2.4.png").

Additional Info:
OS: Win7 Pro x64



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

Attach Files:

Attached Files
file #28521:  octave_logscale_bug__script_and_screenshots.7z added by None (231KiB - application/octet-stream - Please excuse me for sending an uncomplete bug report previously. This one shall be complete.)


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 None (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 project members can vote.





    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-30 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2013-07-10 rik5 CategoryPlotting => Plotting with OpenGL
        StatusNone => Confirmed
        Summaryxminorticks for a semilogx plot incorrectly displayed => log axis minorticks incorrect if axis limit exceeds 8 orders of magnitude
    2013-07-09 None Attached File- => Added octave_logscale_bug__script_and_screenshots.7z, #28521

    Back to the top

    Powered by Savane 3.9