|
From: sfeam <sf...@us...> - 2015-03-25 15:28:10
|
On Wednesday, 25 March 2015 11:02:11 AM pl...@pi... wrote: > Hi, > > I came across this SVG on WikiPedia and tried to scale up but it would > not budge. > > http://upload.wikimedia.org/wikipedia/commons/e/e5/Window_function_and_frequency_response_-_Cosine.svg > > I had a look at the document source and found that it was created by > gnuplot 4.6 patch level 0. That is ostensibly the same as I use on my > embedded system and it produces SVG that do scale perfectly. > > I do notice that the group "gnuplot_canvas" on mine in inside a rect , > while thier non-scaling one it's the other way around, the rect is the > outermost element. > > <!-- Tie mousing to entire bounding box of the plot --> > <rect x="0" y="0" width="600" height="480" fill="#ffffff" stroke="black" > stroke-width="1" > onclick="gnuplot_svg.toggleCoordBox(evt)" > onmousemove="gnuplot_svg.moveCoordBox(evt)"/> > > <!-- Also track mouse when it is on a plot element --> > <g id="gnuplot_canvas" onclick="gnuplot_svg.toggleCoordBox(evt)" > onmousemove="gnuplot_svg.moveCoordBox(evt)"> > > > > <g id="gnuplot_canvas"> > <rect x="0" y="0" width="576" height="288" fill="none"/> > > > Now I can't understand why the WP graph is not scalable, indeed what is > the point of scalable vector graphic that will not scale. > > Am I missing something? When you select the svg terminal in gnuplot, you have the option of adding a keyword "fixed" or "dynamic", as in set term svg size 576, 288 fixed The primary use for this that I know of is to control what happens if you display the svg graph inside an HTML element that is itself of a fixed size. In one case a browser will typically show only a window into the svg graph and will provide slider bars to move the window; in the other case it will typically scale the graph to fit in the HTML element. Both cases are controlled by the browser and thus may vary across platforms, versions, and perhaps the phase of the moon. This is particularly true if, as in the URL you gave, the svg plot is not embedded in an HTML element. If you view that same svg plot via the Wikipedia page in which it is embedded http://en.wikipedia.org/wiki/Window_function I think you will find that it does scale with the rest of the page. IIRC this is also relevant to embedding svg elements inside each other, but I don't have an example to give. Ethan |