Hi,

I just noticed this doesn't work here, too, as I expected :(

with u'äöüß°€' I can print the string, but the labels are still broken
in the plot:

# -*- coding: utf-8 -*-

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])

xlabel = r'öäüß°€'
plt.xlabel(xlabel)
plt.show()
plt.savefig('asdf')

Would be interesting to know what's going on...


2011/6/9 Klonuo Umom <klo...@gmail.com>:
> Here is trace if I run this UTF-8 encoded file:
>
> =======================================
> #-*- coding: utf-8 -*-
> import matplotlib.pyplot as plt
> plt.plot([1,2,3,4])
> plt.ylabel(r'Пајтон')
> plt.show()
> ---------------------------------------
>
> on command line:
>
> =======================================
> Traceback (most recent call last):
>  File "C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4.py", 
> line 208, in resizeEvent
>    self.draw()
>  File "C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.py", 
> line 130, in draw
>    FigureCanvasAgg.draw(self)
>  File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", 
> line 394, in draw
>    self.figure.draw(self.renderer)
>  File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in 
> draw_wrapper
>    draw(artist, renderer, *args, **kwargs)
>  File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 798, in draw
>    func(*args)
>  File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in 
> draw_wrapper
>    draw(artist, renderer, *args, **kwargs)
>  File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 1946, in draw
>    a.draw(renderer)
>  File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in 
> draw_wrapper
>    draw(artist, renderer, *args, **kwargs)
>  File "C:\Python26\lib\site-packages\matplotlib\axis.py", line 1032, in draw
>    self.label.draw(renderer)
>  File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in 
> draw_wrapper
>    draw(artist, renderer, *args, **kwargs)
>  File "C:\Python26\lib\site-packages\matplotlib\text.py", line 526, in draw
>    bbox, info = self._get_layout(renderer)
>  File "C:\Python26\lib\site-packages\matplotlib\text.py", line 305, in 
> _get_layout
>    clean_line, ismath = self.is_math_text(line)
>  File "C:\Python26\lib\site-packages\matplotlib\text.py", line 989, in 
> is_math_text
>    if cbook.is_math_text(s):
>  File "C:\Python26\lib\site-packages\matplotlib\cbook.py", line 1793, in 
> is_math_text
>    s = unicode(s)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: 
> ordinal not in range(128)
>
> ------------------------------------------------------------------------------
> 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-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

------------------------------------------------------------------------------
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to