Sergey
Sergey

Reputation: 21211

How to plot a graph in SAGE using non-english symbols?

Simple command I try to run:

sage: Graph({'Б':[1,2]}).plot().save('/tmp.plot.png')

fails:

/usr/lib/sagemath/local/lib/python2.7/site-packages/matplotlib-1.5.1-py2.7-linux-x86_64.egg/matplotlib/text.py in set_text(self, s)
   1204         ACCEPTS: string or anything printable with '%s' conversion.
   1205         """
-> 1206         self._text = '%s' % (s,)
   1207         self.stale = True
   1208 

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Can someone help with this?

SageMath version 7.2, Release Date: 2016-05-15

Upvotes: 0

Views: 114

Answers (1)

kcrisman
kcrisman

Reputation: 4402

Apparently the way we use matplotlib doesn't allow non-ascii strings. See Trac 21008.

Update: This ticket now has a fix and positive review, so hopefully it will be in Sage 7.3, or possibly 7.4 depending on how fast 7.3 gets out.

Upvotes: 1

Related Questions