Minified code sample which produces problem:
reset
unset output
set terminal wxt
set style histogram columnstacked
set style data histogram
plot "deletions.stat" using 2:key(1) title columnhead , "" using 3 title columnhead
deletions.stat:
Number One Two
Stack1 2 4
Stack2 3 6
What I get is:
http://snag.gy/0mGqz.jpg
However, the key for Stack1 should be green - not red.
Is this intended? Am I missing something? Is it a bug?
Note: Leaving out ":key(1)" solves this problem as the key is not shown any more. Another solution is leaving out both instances of "to col", but I need them there.
Note: Using "set key autotitle columnheader" instead of "title columnhead" does not help, either.
Sorry, I did not realize that I was running old version 4.6.0. With 4.6.3 the example works fine. However, leaving out "title column" and not having "set key autotitle columnheader" still produces wrong colors.
Another (probably strongly connected!?) problem:
add "set style fill pattern"
The patterns are also off by one even with version 4.6.3
Complete example showing weird behaviour:
reset
unset output
set terminal wxt
set style histogram columnstacked
set style data histogram
set style fill pattern
plot "deletions.stat" using 3:key(1) , "" using 4:key(1) ti col , "" using 5:key(1)
deletions.stat
Number DUMMY Two Three
Stack1 0 2 4 5
Stack2 0 3 6 1
Output: http://snag.gy/gxLip.jpg
Last edit: NotDifficult 2013-07-03
Thank you for the bug report.
The primary bug was fixed in CVS several months ago. The current development version (4.7) handles the sequence of pattern fills correctly, and the fix will be in the next release 4.6.4.
The "weird behaviour" is a result of failing to set "set key autotitle columnhead". In the absence of this command the first line of the input file is interpreted as data, rather than as titles, which causes the count of data entries to be off by one. Arguably there should be some other way for the program to know that the first input line is not actually data, but for now the autotitle command is required.
Could you please provide a testing binary of the current development version for Windows?
http://www.gnuplot.info/development/binaries/gp470-20130425-win32-mingw.exe does not yet fix the problem. Thanks!
An updated testing binary is now available.