Hi everyone,
first of all, I wonder why no one has brought this subject up yet. Gnuplot 5 has been out for a while. Maybe I am doing something completely wrong? Anyway.
For me, SVG output on gnuplot5 is incompatible to gnuplot 4. The major difference is: with gnuplot 4, a "set terminal svg font 'Arial,20'" uset to be to translated to a "font-family:Arial; font-size:20.00pt;" in SVG output. With gnuplot 5, the unit ist missing, so it's just a "font-family=Arial font-size=20.00".
By the SVG interpeter, the font size thus is given in native SVG units. In the case of Inkscape, this would be 1/96 inch. That's remarkably smaller than 1pt (1/72 inch).
This behaviour might be intended. SVG terminal size ist interpreted in native units as well, after all. In this case, the documentation would be wrong. And what's more important, the graph geometry (label distance etc.), which is still based on a font size in points, is wrong. Spaces are way too large. So it's clearly a bug.
I have tested this with gnuplot-5.0.7, gnuplot 5.2.2, and today's gnuplot-main from sourceforge. My platform is a home-grown Linux based on gnome 3.
I personally would prefer all terminal types to produce more ore less the same output, depending of the capability of the terminal. I do not see this to happen, though. The more important it is to have one reliable sort of vector graphics output that can be converted to any kind of graphics you want. SVG is a good candidate for this. As long, as it works ...
Anyway. Thank you for gnuplot. I appreciate your work.
Best regards,
Erik
For vector-based terminals, including svg, the scale is essentially arbitrary. The visual size is determined in the end by the page size of the document it is embedded in. In order to allow the same script to produce the correct visual font, point, and line sizes on multiple terminals or multiple eventual display media gnuplot provides additional options to the "set term" command. The intended way to handle the specific case you mention is to add "fontscale 96./72.". If you later determine that the svg file will be scaled up an additional factor of, say, 2.5 for printing then to retain absolute (unscaled) font size you would rerun the gnuplot script saying instead something like
set term svg fontscale (96./72.)/2.5
Conversely if you want to achieve the same ultimate document size by producing an svg file that is intrisically larger and thus does not need to be rescaled later you could instead use something like
set term svg size 600BIG,480BIG fontscale BIG linewidth BIG
A typical use is for preparing a poster-size version of a figure originally composed for a typical journal-size page layout.
Some terminals also provide "pointscale BIG" but I see that the svg terminal is missing this one.
As to problems with the spacing allowed for text in svg output, the text component of plots in the on-line svg demo collection looks reasonable and I do not recall any bug reports for svg text placement issues. So if you have found a case where it is clearly wrong that is probably a bug worth reporting separately.