ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 01 Aug 2012 03:28:42 +0200A bug in graphics.pyhttps://ask.sagemath.org/question/7508/a-bug-in-graphicspy/ Several hours ago I post my question about unicode support in "axes_labels",here is [my question](http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label)<p>
I am sure this is really a bug of sage,I don't know how to report this bug as the spreadsheets.google.com is block by Chinese government.<p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"<p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].<p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in <p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py<p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is <p>
self.__axes_labels = (str(l[0]), str(l[1]))<p>
It is obviously that the problem is caused by the str(),after change this line to <p>self.__axes_labels = (l[0], l[1])<p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).<p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data<p>
First,we need to download one free unicode font,more information can refer to [WikiPedia](http://en.wikipedia.org/wiki/Unicode_typefaces),and I use [Bitstream Cyberbit](http://en.fonts2u.com/download/bitstream-cyberbit.font) for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.<p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of <p>
font.family : sans-serif<p>
font.style : normal<p>
font.variant : normal<p>
font.weight : medium<p>
font.stretch : normal<p>
It seems that only sans-serif and serif can work well with unicode.<p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:<p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande<p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:<p>
axes.unicode_minus : False <p>
Save this file and restart Sage,know we can test it with:<p>
plot(x,axes_labels=['z',u'???????'])
<p>It seems that this website does not support unicode.Don't forget the "u" .<p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.<p>
It seems there are also some problems with the LaTeX to deal with Chinese,I will check for it and post my solution.
Sorry for my poor English , and wish to be understood.
Mon, 25 Jun 2012 11:00:49 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/Comment by shahuwang for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div>https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19503#post-id-19503I update my question with my solution posted.Tue, 26 Jun 2012 10:28:11 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19503#post-id-19503Comment by kcrisman for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div>https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19505#post-id-19505Ah, so you are saying that we would need to include additional fonts?Mon, 25 Jun 2012 15:41:10 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19505#post-id-19505Comment by shahuwang for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div>https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19507#post-id-19507I see that you post a problem in the "Trac 13161" of Korean , the problem is the same with me as matplotlib come with some fonts only support ASCII. So I think you should put more free fonts in matplotlib and make some change in matplotlibrcMon, 25 Jun 2012 13:35:40 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19507#post-id-19507Comment by kcrisman for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div>https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19514#post-id-19514An unrelated, but useful, comment; "and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage" is not necessary; if you just restart sage with the `sage -b` flag it should make the changes you made in `graphics.py` live.Mon, 25 Jun 2012 12:27:35 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19514#post-id-19514Comment by kcrisman for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div>https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19335#post-id-19335@shahuwang: Hey, this Trac ticket has positive review now. I would love to be able to add your name as an author - and hence newest contributor to Sage! See http://trac.sagemath.org/sage_trac/ticket/13161#comment:11Thu, 26 Jul 2012 13:19:13 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19335#post-id-19335Answer by kcrisman for <div class="snippet"><p>Several hours ago I post my question about unicode support in "axes_labels",here is <a href="http://ask.sagemath.org/question/1557/why-sage-can-not-plot-chinese-label">my question</a></p><p>I am sure this is really a bug of sage,I don't know how to report this bug as the <a href="http://spreadsheets.google.com">spreadsheets.google.com</a> is block by Chinese government.</p><p>
As we know that Matplotlib supports unicode with some setting in "matplotlibrc",and I make it work with Chinese characters now.But when I want to set the axes labels to some Chinese characters with "axes_labels" attribute ,I got exception:"UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in
position 0: ordinal not in range(128)"</p><p>
After I changed some code in sage/local/lib/python/site.py,I set the default encoding to "utf-8",that exception never raise again.But the problem does not be solved as the Chinese characters shown in the axes labels all become boxs like [].</p><p>
Why I can set the axes labels in Chinese with matplotlib but can not in sage? After I check the source code in </p><p>SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.py</p><p>
In line 634 of the method "def axes_labels(self, l=None)",I found the line is </p><p>
self.__axes_labels = (str(l[0]), str(l[1]))</p><p>
It is obviously that the problem is caused by the str(),after change this line to </p><p>self.__axes_labels = (l[0], l[1])</p><p>
and remove the SAGE/local/lib/python2.7/site-packages/sage/plot/graphics.pyc,restart sage , I finally got this problem solved.Now Sage gets no problem to work with Chinese,or in other word,gets no problem to work with unicode(utf-8).</p><p>
There is some work to do with matplotlibrc,it is in sage/local/lib/python/site-packages/matplotlib/mpl-data</p><p>
First,we need to download one free unicode font,more information can refer to <a href="http://en.wikipedia.org/wiki/Unicode_typefaces">WikiPedia</a>,and I use <a href="http://en.fonts2u.com/download/bitstream-cyberbit.font">Bitstream Cyberbit</a> for a test.I think there are more better unicode fonts.Bitstream Cyberbit can work well with Chinese,Japanese,Korean in my test.</p><p>
After unzip the downloaded file,get the Cyberbit.ttf and put it into sage/local/lib/python/site-packages/matplotlib/mpl-data/fonts/ttf.And then open the matplotlibrc,remove the "#" which at the begin of </p><p>
font.family : sans-serif</p><p>
font.style : normal</p><p>
font.variant : normal</p><p>
font.weight : medium</p><p>
font.stretch : normal</p><p>
It seems that only sans-serif and serif can work well with unicode.</p><p>
And then ,remove the "#" at the begin of "font.sans-serif " in line 129,add "Bitstream Cyberbit" after ":",it must put on the first,like:</p><p>
font.sans-serif : Bitstream Cyberbit,Microsoft YaHei,Bitstream Vera Sans, Lucida Grande</p><p>
It also needs to remove the "#" in the begin of axes.unicode_minus,and set the boolean value to "False",for example:</p><p>
axes.unicode_minus : False </p><p>
Save this file and restart Sage,know we can test it with:</p><p>
plot(x,axes_labels=['z',u'???????'])
</p><p>It seems that this website does not support unicode.Don't forget the "u" .</p><p>
The Bitstream Cyberbit,though work well with unicode,I think it is not so beautiful.Maybe there is better one.</p><p>
It ...<span class="expander"> <a>(more)</a></span></p></div> https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?answer=13760#post-id-13760This seems to still be try in Sage 5.1.beta5. I've opened [Trac 13161](http://trac.sagemath.org/sage_trac/ticket/13161) for this. If you get an account there, you can even upload a patch (see the [developer guide](http://www.sagemath.org/doc/developer/index.html)) and we can give you author credit!
I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.Mon, 25 Jun 2012 12:38:31 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?answer=13760#post-id-13760Comment by kcrisman for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19394#post-id-19394You may be interested in the update http://trac.sagemath.org/sage_trac/ticket/13161#comment:4Tue, 17 Jul 2012 12:30:06 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19394#post-id-19394Comment by kcrisman for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19334#post-id-19334This ticket now has positive review.Thu, 26 Jul 2012 13:19:34 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19334#post-id-19334Comment by shahuwang for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19302#post-id-19302I got a account of sage develop trac,which the user name is shahuwang,and I also map it to my real name on the list.Thanks again!Wed, 01 Aug 2012 03:28:42 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19302#post-id-19302Comment by shahuwang for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19306#post-id-19306I see it,thanks to review it,wish I can help moreTue, 31 Jul 2012 11:01:10 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19306#post-id-19306Comment by kcrisman for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19305#post-id-19305Please do, by giving us your *real name* so that we can properly acknowledge you as one of the authors!Tue, 31 Jul 2012 14:28:08 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19305#post-id-19305Comment by shahuwang for <p>This seems to still be try in Sage 5.1.beta5. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13161">Trac 13161</a> for this. If you get an account there, you can even upload a patch (see the <a href="http://www.sagemath.org/doc/developer/index.html">developer guide</a>) and we can give you author credit!</p>
<p>I'm wondering if that is the whole solution, by the way; we don't really want end users to need to do something with their rc files just to plot axes labels.</p>
https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19508#post-id-19508It takes some time to set the matplotlibrc file,as it come with no font that support Chinese.It seems that there are only fonts that support ASCII .I wish next released to get the matplotlibrc setted to support unicode and with some free fonts to support non-ASCII used countries such as China,Japan. Wish to help moreMon, 25 Jun 2012 13:25:02 +0200https://ask.sagemath.org/question/7508/a-bug-in-graphicspy/?comment=19508#post-id-19508