how to rotate an SVG file 90 degrees?

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.


Solution 1:

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