gnuplot version 6.1 git (2025-05-20)
Ubuntu 20.04 (x86-64)
Asking for "help size" says:
`set term <terminal_type> size <x units>, <y units>` controls the size of the
output file, or `canvas`. Please see individual terminal documentation for the
units of the size parameters.
But then asking for "help svg" gives:
where <x> and <y> are the size of the SVG plot to generate,
`dynamic` allows a svg-viewer to resize plot, whereas the default
setting, `fixed`, will request an absolute size.
which does not document the units of the size parameters.
You raise a good point.
As I understand it, the SVG units are dimensionless. The physical size of the plot you see is determined by the document in which the svg figure is embedded. For instance in an HTML web page the figure is embedded by a command like this:
So the on-screen size reserved for the plot will be 500 pixels by 400 pixels regardless of what range of coordinates the svg file uses internally. Suppose you created a plot by requesting
set term svg size 1000,700
and then embedded it in a web page using the commands above. When you view the web page in a browser, the browser will scale the svg figure to fit the reserved space. In this example the svg x coordinates, which run from 0-1000, will be scaled to fill a width of 500 pixels. I.e. a scale factor of 50%. If this same scaling is applied to the y coordinates then the svg y coordinate range 0-700 would be mapped onto 350 vertical pixels in the displayed page; i.e. less than the 400 pixels that were reserved for it. I do not know if there is some standard that specifies what is supposed to happen in case of a mismatch like this. In practice I see extra whitespace above and/or below the plot, which retains its 5:4 aspect ratio. But it could be that other browsers or viewing programs would distort the original aspect ratio to fill the reserved space.Short version: You can think of svg terminal "size" units as arbitrary integer units whose magnitude sets a limit on the precision of the coordinates used to describe the lines and points being plotted. Setting
size 1000,700
gives you 10 times the precision assize 100,70
. But the physical size you see on a page or on a screen is determined elsewhere.