Ask Your Question
3

Cyrillic in matplotlib

asked 2012-04-16 08:34:31 +0100

kote gravatar image

updated 2015-01-14 11:58:24 +0100

FrédéricC gravatar image

I try to add some utf8 chars for figure legend and axis labels. This don't work. Found some example

#!/usr/bin/env pytnon
reset()
from matplotlib import rc
rc('font',**{'family':'serif'})
rc('text', usetex=True)
rc('text.latex',unicode=True)
rc('text.latex',preamble='\usepackage[utf8]{inputenc}')
rc('text.latex',preamble='\usepackage[russian]{babel}')

from pylab import *

x = linspace(0,2*pi,100)
y = sin(x)
plot(x,y,'-')
xlabel(u"??? ???????")
ylabel(u"??? ???????")
savefig('1.png')

but it also don't work correctly. I get latex error (when trying to save figure to *.svg - "Package ucs Error: Unknown Unicode character 134 = U+0086") or wrong characters that obviously not cyrillic. What to do?

edit retag flag offensive close merge delete

Comments

1

omg, even this forum **** the cyrillic symbols(

kote gravatar imagekote ( 2012-04-16 08:36:21 +0100 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-04-18 15:23:06 +0100

Jason Grout gravatar image

I would post to the matplotlib-users mailing list, since you are using straight matplotlib here. https://lists.sourceforge.net/lists/l...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-04-16 08:34:31 +0100

Seen: 995 times

Last updated: Apr 18 '12