I'm having trouble with gnuplot 5.0.6 (openSUSE Tumbleweed, x86_64) sometimes not showing a ytic label in pdfcairo although the ticmark is printed. The (minimal) example creates a pdf file where the given ytic at 0.01811 has no label.
Working around this by e.g. using sprintf or giving the number manually does not work. I included some more working and non-working examples.
set terminal pdfcairo
set grid layerdefault
set output 'test.pdf'
set format x ""
set format y "%1.5f"
set yrange [0:0.05]
# does not work:
set ytics (0.01811)
# set ytics ("0.01811" 0.01811)
# set ytics ("t0.01811s" 0.01811)
# set ytics (0.01811, 0.02)
# works:
# set ytics (0.0181)
# set ytics ("s" 0.01811)
# set ytics (0.01811, 0.01)
# set ytics (0.0182)
# set ytics (0.0299022968168612, 0.0417547225952148, 0.01811, 0.01)
plot x
I cannot reproduce this problem using any of versions 5.0.0, 5.0.1, 5.0.6, or current cvs.
Does it make any difference if you make the left margin larger? E.g. "set lmargin at 0.25"
I can even reproduce it with 5.2-rc1 :( - this is using cairo 1.15.4 (will try 1.15.6 tomorrow).
I even have some more font-related bugs but let me show you this one first in the attached example output files generated from the posted script
Last edit: NicoK 2017-06-16
unfortunately, cairo 1.15.6 did not improve anything :(
getting there...
using
set lmargin at screen 0.5for theset ytics (0.01811, 0.02)command yields to the attached result with one label being correctly aligned and the other too far away from the plot's borderFYI: using another terminal, e.g.
set terminal png, does not result in this behaviourAll I can do is scratch my head.
I still don't see anything like that here (lib64cairo2-1.14.0).
Have you tried different fonts?
You say "set term png" is OK. I assume that's the libgd png terminal. What about other cairo-based terminals? Try "set term pngcairo" or "set term wxt". If the display in the wxt terminal is correct, you could go one step further and test whether the "export to pdf" button on the display window matches the (good) wxt version or the (bad) pdf version.
pngcairoworks just finewxtalso works fine in the windowwxtexport to png or svg looks goodwxtexport to pdf shows the same behaviour thanpdfcairoexcept for the actual distance of the label from the plot (see the attachedtest-with-lmargin-from-wxt.pdffile)export to pdffrom wxt shows bad version and results in a 7.7KB file, if I hitexport to pdfa second time, the resulting file will be 8.2KB and looks just fine - following up on this, by adding this technique to the original code, it also works, i.e. having the script end with:On a second set of experiments with different fonts: I do have msttfonts installed and with that:
Sansfamily (according to the docs), choosesarial.ttfand shows the bad versionfont "Liberation Sans,12"instead works finefont "Serif"vs.font "Liberation Sans"To sum up: there seems to be some bug with the MS true type fonts which only seem to work correctly on the second plot. Now this, or setting another font specifically, are both only (ugly) workarounds.