I know that Matplotlib does not support UTF-8 without some change in matplotlibrc,So I edit the matplotlibrc and now when plot with matplotlib in sagenb,it supports UTF-8 now and it can show Chinese now.
But for the sage plot function, when I want to set label with some Chinese characters,it raise exception :
UnicodeEncodeError: 'ascii' codec can't encode character u'\u6211' in position 0: ordinal not in range(128).
After I set the default encoding to UTF-8 in site.py,this exception does not raise again,but the Chinese characters are shown as box like [].
Below is my code:
p1=plot(sin,(-2*pi,2*pi),thickness=2.0,rgbcolor=(0.5,1,0),legend_label='sin(x)')
p2=plot(cos,(-2*pi,2*pi),thickness=3.0,color='purple',alpha=0.5,legend_label='cos(x)')
plt=p1+p2
x = u'???????'
plt.axes_labels((x,'y'))
show(plt)
Is there any solution?