bugGNU Octave - Bugs: bug #40256, set (gca, 'xticklabel') command...


bug #40256: set (gca, 'xticklabel') command not working properly (gnuplot)

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sun 13 Oct 2013 04:57:55 PM UTC
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sat 14 Jun 2014 05:34:23 AM UTC, comment #8: 

I backported Stefan's fix to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/9c2ff2361864).  The patches that do cleanup I applied to the development branch.  Thanks to Stefan's work I'm marking this as fixed and closing the report.

Rik <rik5>
Group administrator
Sun 02 Mar 2014 02:09:32 AM UTC, comment #7: 

I attached three changesets
- ticklabel_minor_grid.diff fixes both errors
- cleanup_ticklabel.diff remove unneeded ticklabel conversions (see bug 34906)
- cleanup_do_tics_1.diff cleanup

Hopefully no new regressions :)

(file #30748, file #30749, file #30750)

Stefan Mahr <dac922>
Sat 01 Mar 2014 03:34:34 PM UTC, comment #6: 

The fix for this bug invalidates the fix for bug #38139.  It looks like something better needs to be done so that both this bug and #38139 remain fixed at the same time.  I'm re-opening both bug reports and cross-referencing them.

Rik <rik5>
Group administrator
Sat 09 Nov 2013 03:35:11 PM UTC, comment #5: 

Also thanks from me Stefan.

Works OK here.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 09 Nov 2013 03:16:51 PM UTC, comment #4: 

Thanks Stefan.  I applied your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/5740407c25b2).  We are nearly there for the release now.

Rik <rik5>
Group administrator
Fri 08 Nov 2013 10:29:04 PM UTC, comment #3: 

Attached patch fixes this bug for the example below.

Rik, there are a lot of ticklabel conversions in _go_draw_axes_.m
Many of this conversions are already done in graphic.cc (see for example bug 34906 ), so I could clean up _go_draw_axes_.m a little bit. But I suggest to do this after the release.

(file #29576)

Stefan Mahr <dac922>
Thu 07 Nov 2013 04:15:51 PM UTC, comment #2: 

The problem is not with datetick, but rather with how the command "set (gca, 'xticklabel', ...)" works.  Instead of just overwriting the existing labels, this is apparently invoking the auto-axis labeling routine.  Simple code to reproduce:

graphics_toolkit gnuplot
plot (1:4)
## At this point labels are 1, 1.5, 2, 2.5, 3, 3.5, 4
set (gca, 'xtick', 1:4)
## At this point labels are 1, 2, 3, 4
set (gca, 'xticklabel', {'A', 'B', 'C', 'D'})
## Now labels are 'A', 1.5, 'B', 2.5, 'C', 3.5, 'D'

Rik <rik5>
Group administrator
Mon 14 Oct 2013 12:15:54 AM UTC, comment #1: 

Confirmed.  And this is a regression from 3.6.4 so I have marked it as such and added it to the 3.8 Bug Fix List before release.

Rik <rik5>
Group administrator
Sun 13 Oct 2013 04:57:55 PM UTC, original submission:  

When invoking datetick, and if datetick needs to recompute the X-axis tick, grid & label positions, it is expected that the previous ticks, vertical grid lines and labels are removed.
When using gnuplot this doesn't happen (fltk works correctly).

Steps to reproduce (use attached data in file series.mat, as those data require datetick to recompute the X-ticks):

load series.mat
graphics_toolkit gnuplot
plot (series(:, 1), series(:, 2))

and you'll get the result in the attached picture.

This works correctly with gnuplot in octave-3.6.4 for MinGW.

If it helps: the oldest 3.7.x I have installed is Michael's 3.7.2+ MSVC snapshot binary, and that has this bug. So it must have sneaked in before Feb 22, 2013 (creation date of octave-3.7.2+.exe)

Philip Nienhuis <philipnienhuis>
Group Member


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

Attach Files:

Attached Files
file #30748:  ticklabel_minor_grid.diff added by dac922 (5KiB - text/x-patch)
file #30749:  cleanup_ticklabel.diff added by dac922 (3KiB - text/x-patch)
file #30750:  cleanup_do_tics_1.diff added by dac922 (3KiB - text/x-patch)
file #29576:  gnuplot_ticklabel.diff added by dac922 (1KiB - text/x-patch)
file #29366:  gp_datetick.png added by philipnienhuis (17KiB - image/png)
file #29367:  series.mat added by philipnienhuis (3KiB - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by dac922 (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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 group members can vote.


    Follow 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-06-14 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-03-02 dac922 Attached File- Added ticklabel_minor_grid.diff, #30748
        Attached File- Added cleanup_ticklabel.diff, #30749
        Attached File- Added cleanup_do_tics_1.diff, #30750
    2014-03-01 rik5 StatusFixed Confirmed
        Open/ClosedClosed Open
    2014-03-01 rik5 Dependencies- bugs #38139 is dependent
    2013-11-09 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-11-08 dac922 Attached File- Added gnuplot_ticklabel.diff, #29576
    2013-11-07 rik5 Summarygnuplot - datetick doesn\'t remove previous X-grid, -ticks &amp; labels set (gca, 'xticklabel') command not working properly (gnuplot)
    2013-10-14 rik5 Item GroupIncorrect Result Regression
        StatusNone Confirmed
    2013-10-13 philipnienhuis Attached File- Added gp_datetick.png, #29366
        Attached File- Added series.mat, #29367

    Back to the top

    Powered by Savane 3.13.
    Corresponding source code