Problem The text painted with the 'text' function and any other lettering on the axes is 25% larger than requested
Here is a small example program that will reproduce the problem:
import matplotlib as mpl
mpl.rcParams['svg.fonttype'] = 'none'
mpl.rcParams['font.sans-serif'] = ['Arial']
for f in xrange(5):
Opening up test.svg in inkscape will have all fontsizes larger by 25% (x 1.25)
Matplotlib version 1.2.0
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Are you also using tex? The reason I ask is because I just found this line and this line in another PR. This may be a red herring, but I thought I would point it out so someone could look into it at some point.
Hi dmcdougall: that's an important thought, but no. This is regular text.
This is a tricky problem. There are seemingly differences of opinion about how font size units are handled in SVG. Chrome, Firefox and Inkscape handle them all differently. What we have now works with Chrome and Firefox and is at least the "correct" size in Inkscape, even though it isn't displayed as such. And it's a hack -- the size of the image is specified in points, which causes 1 pixel === 1 point in user space, and then the font size is specified in pixels. Inkscape gets confused because it wants to display the fontsize in points in its UI. This can be fixed to work as expected in Inkscape, (by specifying all units in pixels, but not all in points, interestingly enough) but then the output doesn't display correctly on Chrome or Firefox. This could be made a user option, but I'm wary of adding more obscure user options. SVG standards compliance is not the greatest ;(
@mdboom Interesting! I hadn't realised standards compliance was so shoddy.
I think it's reasonable to label this as WONTFIX, for the very reason of standards compliance.
@kghose Have you tried creating a pdf or eps file and using a third-party tool to convert to SVG? There may be third-party solutions that allow the user to adjust certain elements of the file, e.g. font size.
Since this appears to be an issue of different browsers implementing different standards, I've labelled this as 'wontfix' and I'm going to close it. If somebody feels there is a way to fix this then please feel free to reopen it.