0
votes

I have recently found an issue with alignment in Gnuplot graphs. I have selected simple plot as demonstration - code:

plot sin(x)
set term wxt size 1600,1200 enhanced lw 2 font "Arial, 14"

will produce this plot [click here].

The problem is seen for example at "0" tick, where the value is not centered with the tick, or at legend text, which is not vertically centered with the key symbol.

I have discovered, that the issue will disappear when Qt terminal is selected, but I will still rather use wxt and these little imperfections bother me a lot. The issue is still present when pdf terminal is selected.

My thought is that such behavior is related to high screen resolution (4k) on Windows system,as I have never observed such thing as PCs with standard monitors (i.e 1920x1080 px resolution).

The situation gets better when the application is downscaled by system, but this setting produces pixelated plots via wxt terminal.

Does anybody know how to deal with this? Thank you for any advice :-)

1
I believe gnuplot has to use estimates for the dimensions of rendered text, which works better for some terminals than for others (and it might depend on the chosen font). A nice way to see this is to look at the output of the test command which at its center shows the actual vs. estimated text dimension. On my system there are significant differences in wxt but not for the x11 terminal. - user8153
Thanks! I have tried the test command and it looks like everything is fine when using Qt terminal. I will just use this one for a while :-) - Rostislav Linda

1 Answers

1
votes

The default format for axis tics is "% h". Note the space in front of the h. I think what your are seeing is that the label is actually " 0" and the placement centers the pair of characters.

set format "%h"

You can change the default format to "%h" instead, but be warned that this may possibly cause other obscure problems due to the program assuming there is always a space preceding an axis label.