SVG export mangled

Hi folks,
when I tried to export figures as SVG, the result was completely messed
up. Export in other formats works.

Appended you find:
* Script to reproduce error
* Broken SVG
* Working EPS
* Broken SVG rendered by Gnome image viewer (eog)
* Broken SVG rendered by Inkscape

Setup:
Ubuntu 10.04 LTS
Python 2.6.5 (stock)
Matplotlib current version from git, installed with "python setupegg.py
develop"

Can you reproduce the problem on your machine?

Greetings,
Dieter

savefig.eog.png

savefig.eps (10.4 KB)

savefig.inkscape.png

savefig.svg

svg-export2.py (194 Bytes)

I see what is happening here… The SVG backend was recently
re-written to write some of the path data in C – unfortunately the
numbers being written there are locale-aware, and in your locale it
appears to be using ‘,’ as a decimal point.

I put up a fix for this here:

In the meantime, you may have some luck by setting your locale

before running python, i.e.:
LANG=en_US.UTF-8 python svg_export2.py
Cheers,
Mike

···

https://github.com/matplotlib/matplotlib/pull/369


Hi folks,
when I tried to export figures as SVG, the result was completely messed
up. Export in other formats works. Appended you find:
* Script to reproduce error
* Broken SVG
* Working EPS
* Broken SVG rendered by Gnome image viewer (eog)
* Broken SVG rendered by Inkscape
Setup:
Ubuntu 10.04 LTS
Python 2.6.5 (stock)
Matplotlib current version from git, installed with "python setupegg.py
develop"
Can you reproduce the problem on your machine?
Greetings,
Dieter


EditLive Enterprise is the world’s most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.


Matplotlib-devel mailing list

-- Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

http://p.sf.net/sfu/ephox-dev2dev


Matplotlib-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Hi Mike,
your changes in the pull request fixed the problem for me, thanks a lot!

Greetings,
Dieter

···

Am Dienstag, den 21.06.2011, 09:01 -0400 schrieb Michael Droettboom:

I see what is happening here... The SVG backend was recently
re-written to write some of the path data in C -- unfortunately the
numbers being written there are locale-aware, and in your locale it
appears to be using ',' as a decimal point.

I put up a fix for this here:

https://github.com/matplotlib/matplotlib/pull/369

In the meantime, you may have some luck by setting your locale before
running python, i.e.:

  LANG=en_US.UTF-8 python svg_export2.py

Cheers,
Mike

On 06/21/2011 06:47 AM, Dieter Weber wrote:
> Hi folks,
> when I tried to export figures as SVG, the result was completely messed
> up. Export in other formats works.
>
> Appended you find:
> * Script to reproduce error
> * Broken SVG
> * Working EPS
> * Broken SVG rendered by Gnome image viewer (eog)
> * Broken SVG rendered by Inkscape
>
> Setup:
> Ubuntu 10.04 LTS
> Python 2.6.5 (stock)
> Matplotlib current version from git, installed with "python setupegg.py
> develop"
>
> Can you reproduce the problem on your machine?
>
> Greetings,
> Dieter
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
>
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel