|
From: Mathieu L. <lep...@gm...> - 2008-08-25 21:26:41
|
Hi, If I change the locale using cairo backend, the result is fine. But with SVG backend, every objects collapse on top-left corner. As you can see here : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.svg I exported it to png with inkscape to reveal objects outside of frame : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.png Cairo output is fine : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-cairo.svg I guess it's not a unicode problem, since the strings have no non-ascii characters. The code is quite straightforward, it allows me to choose the date language for the formatters. Let me know if I should fill a bug report. Thank you all ! ---- import locale, matplotlib from datetime import datetime matplotlib.use('svg') import pylab, numpy locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') today = datetime.today().strftime("%A") pylab.title( today ) pylab.plot( range(10), numpy.random.randn( 10 )) pylab.savefig('localechange-%s' % matplotlib.get_backend()) ---- |