#1267 Set grid causes faulty display with boxes


Dear gnuplot maintainers,

today I encountered a non-expected behavior when updating gnuplot to 4.6p3 and running a script that works well with gnuplot 4.6p0. When adding a "set grid front" line, boxes are drawn down to the lower picture border instead of down to the x axis.
Platform is Windows XP 32 bit, precompiled Windows32 binary (gp463-win32-setup.exe) downloaded yesterday from Sourceforge.

I managed to reduce the behavior to the following script:
# Begin script
set datafile separator ";"
# COMMENTING OUT THE FOLLOWING LINE yields correct output,
# leaving it active produces boxes starting from the lower picture border
# instead of from the x axis.
set grid front linetype 0 linewidth 1.000, linetype 0 linewidth 1.000

set terminal png nocrop size 900,900
set output './grid-bug.png'
plot './grid-bug.csv' using 1:2 with boxes
# end script

# Begin data file grid-bug.csv
# 1;10
# 2;5
# 3;12

Did not find something related in the archive...
thanks in advance,
best regards

1 Attachments


  • Ethan Merritt

    Ethan Merritt - 2013-08-06
  • Ethan Merritt

    Ethan Merritt - 2013-08-06

    Interesting bug :-)
    The current CVS version does the same thing.
    But the plot returns to normal if you say "replot".

    • Joachim Fabini

      Joachim Fabini - 2013-08-07

      Thanks for the intermediate fix, it works when using wgnuplot and screen output. However I could not get it to work for file output (png). The bug appears in a rather complex script with secondary axis and file output, this is why it took some time to isolate it.
      Btw, an information which might help to narrow the bug down to some lines of codes: as stated in the original posting, the bug is NOT present in the 4.6p0 version but shows up in 4.6p3 (had these versions running on two PCs and wondered why the one works and the other does not... ;).

  • Ethan Merritt

    Ethan Merritt - 2013-08-08

    Fixed in CVS for 4.6 and 4.7

    This was a hard one to track down, but basically the position of the bottom of the axis in graph coordinate needs to be initialized before plotting. This is normally done just after drawing the grid. But if the grid was set to "front", i.e. drawn after plotting, then this necessary initialization was also deferred [incorrectly] to after drawing the plot.

  • Ethan Merritt

    Ethan Merritt - 2013-08-08
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks