Having an issue when adding a title to a key in the epslatex terminal.
With "set key", everything works. When I add "set key title 'xxx'", then I get an error when attempting to compile the .tex file of "Dimension too large". This appears to be because the key title's y position is being set to funny values like 1073746140 or -2147479442 (see lines 168 and 170 in the attached .tex that has key title enabled).
Provided a MWE demonstrating the funny output.
This is gnuplot 5.4.2 on Windows 10
Thanks in advance!
I can't reproduce this in any of versions 5.2.6 5.4.0 5.4.1 5.4.2 5.5
So I don't think the epslatex terminal is inherently buggy. I'm running on linux, but I have also tried running your test script using the Windows 5.4.1 binary in the wine emulator. No problems there either.
Can anyone on a real Windows 10 system confirm this bug?
I can confirm that this is happening on Windows 10 with gnuplot 5.4.2. Here's a diff of
test_key-title_fig.tex
:Note that -2147479442 is hex 8000106e, 4206 is hex 106e
So it looks like something has flipped a bit in this one number.
1073746140 is hex 400010dc, so that also looks suspiciously like a bit-flip.
Corrupt executable? Compiler error?
Verifyed with gnuplot 5.4.2 on Windows 10. I get correct output using GUI
wgnuplot
, but not with console mode gnuplot. Interestingly, the error goes away if I try to debug optimize with "-Og" instead of "-O2". So this may indeed be compiler related. But, the compiler options for these two gnuplot variants only differ in "-mwindows" vs. "-DWGP_CONSOLE -mconsole". So nothing related to optimisation.gcc version is 10.3.0 (Rev5).
Using
#pragma GCC optimize ("O0")
to disable optimizations for draw_key() in boundary.c solves the issue. Already "O1" shows the problem.