Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When I use Export to export graphics in SVG format, the exported file contains no width height or viewBox attributes, so that the resulting files don't "scale" at all, which is the whole point.

Is there a way to get Export to include size information in exported SVGs?

share|improve this question
I'm not sure what you mean by "scale". If I open an SVG exported from Mathematica in IE9, it definitely "scales" when I zoom up and down using the mousewheel. Did you have something other than that in mind? – Verbeia Jan 16 at 23:55
@Verbeia: Scaling with the window when, for example, its CSS is height:100%; width:100%. – raxacoricofallapatorius Jan 17 at 0:24

1 Answer

Mathematica does not put information about width and height into <svg> tag, but the first group contains a filled rectangle (<rect fill ...>) that does have width and height.

You may extract width and height attributes from that <rect> and assign them to the root <svg> element.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.