hi, all
following is a simple plot. however, if I turn on xkcd(), the legend
shows Chinese as "??". I think this is because the Chinese characters
can not be found in a western font.

Is there a way to fix this?

thanks

[code begin]
#coding=utf-8
import math
from pylab import *
x=range(0, int(2*math.pi*1000))
x=[i/1000.0 for i in x]
y1=[math.sin(i) for i in x]

xkcd()

p=plot(x, y1)

legend(p, [u'sin曲线'])

rcParams['font.sans-serif'] = ['SimHei']    #set the default font to a
Chinese Font
#show()
savefig('%s.png' % __file__)

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to