Hello!
I am trying to use unicode characters in axes labels and it fails with
exception:
P = plot_step_function([(i,prime_pi(i)) for i in
range(20)],thickness=2,color='black')
P.show(axes=False,frame=True,axes_labels=('текс','x'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_28.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding:
utf-8 -*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("UC5zaG93KGF4ZXM9RmFsc2UsZnJhbWU9VHJ1ZSxheGVzX2xhYmVscz0oJ9GC0LXQutGBJywneCcpKQ=="),globals())
+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpzOkGkv/___code___.py", line 2, in <module>
exec
compile(u"P.show(axes=False,frame=True,axes_labels=('\u0442\u0435\u043a
\u0441','x'))" + '\n', '', 'single')
File "", line 1, in <module>
File "/home/sage/sage/local/lib/python2.6/site-packages/sage/misc/
decorators.py", line 456, in wrapper
return func(*args, **kwds)
File "/home/sage/sage/local/lib/python2.6/site-packages/sage/plot/
plot.py", line 1750, in show
self.save(**kwds)
File "/home/sage/sage/local/lib/python2.6/site-packages/sage/misc/
decorators.py", line 456, in wrapper
return func(*args, **kwds)
File "/home/sage/sage/local/lib/python2.6/site-packages/sage/plot/
plot.py", line 2484, in save
transparent=transparent)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
figure.py", line 1084, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backend_bases.py", line 1889, in print_figure
**kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backends/backend_agg.py", line 438, in print_png
FigureCanvasAgg.draw(self)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backends/backend_agg.py", line 394, in draw
self.figure.draw(self.renderer)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
figure.py", line 798, in draw
func(*args)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
axes.py", line 1946, in draw
a.draw(renderer)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
axis.py", line 1032, in draw
self.label.draw(renderer)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py", line 526, in draw
bbox, info = self._get_layout(renderer)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py", line 305, in _get_layout
clean_line, ismath = self.is_math_text(line)
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py", line 989, in is_math_text
if cbook.is_math_text(s):
File "/home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
cbook.py", line 1793, in is_math_text
s = unicode(s)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position
0: ordinal not in range(128)
I found this topic:
https://groups.google.com/group/sage-support/browse_thread/thread/9908f1869c7d7f45/1cc9473c667c162c?hl=en&lnk=gst&q=unicode+axes+labels#1cc9473c667c162c
No responses :(
Could anyone please suggest me something to workaround this problem?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org