how to rotate an SVG file 90 degrees?

8

3

I printed out a diagram from MATLAB and it's rotated 90 degrees clockwise from where it should be.

Is there software that can help me fix this and rotate an SVG file?

I tried tweaking the SVG manually using a <g transform='rotate 90'> element around the whole thing, but it doesn't handle the translation or bounding box correctly and I can't figure out how to get it right.

Jason S

Posted 2012-04-09T19:53:35.023

Reputation: 5 983

Answers

13

Download and install Inkscape, and then open the SVG file with Inkscape!

icon

For my example, this will be our graphic:

before

Now, to rotate the graphic 90 degrees clockwise, we can perform the following:

  1. Edit > Select All

    select all

    preview

  2. Object > Group

    group

    preview

  3. Object > Transform > Rotate

    transform

    rotate

    preview

  4. Object > Ungroup

    ungroup

    after

  5. File > Save

iglvzx

Posted 2012-04-09T19:53:35.023

Reputation: 21 611

that worked -- thank you! (already had inkscape; I didn't think it could handle svg automatically generated by other programs) – Jason S – 2012-04-09T20:13:49.197

1

Well, if the SVG files are to specification, then Inkscape should be able to work with them! :)

– iglvzx – 2012-04-09T20:46:29.393