Change vgsvg.DPI from 90 to 96
Created by: chmike
What are you trying to do?
Generate Plots saved in SVG.
What did you do?
Saved the plot as SVG. Displayed the plot uisng the SVG previewer of studio code, and displayed the plot using Inkscape.
What did you expect to happen?
Get same plot image as with PNG.
What actually happened?
The image frame was bigger than the plot frame. The plot size was requested to be 4*vg.Inch x 4*vg.Inch. The generated svg xml had an svg tag with width and hight defined as 4in as expected. But the plot was smaller.
This is because vgsvg assume that the DPI is 90 while it should be 96. According to this stackoverflow question the DPI of svg has been aligned to the DPI of CSS which is 96. For that reason Inkscape changed it from 90 to 96 in version 0.92. In firefox, the DPI is also 96, but the resulting framing error is not directly visible since the margin is transparent.
Here is another reference stating that the DPI of SVG is aligned to the DPI of CSS and it is 96.
What version of Go and Gonum/plot are you using?
Latest as today, installed with go get.
Does this issue reproduce with the current master?
Don't know.