On 2013-06-09, Sergey Pashinin <[email protected]> wrote:
> I use Ubuntu, Sage and LaTeX. Installed sage from ppa:aims/sagemath.
>
> When I do this in latex:
>
>     \begin{sagesilent}
>       p2 = list_plot(zip(H, f(5)), True, color='blue', axes_labels=[u'$H,$ 
> км',u'$\mu, c$'])
>       p2.fontsize(14)
>     \end{sagesilent}
>
> and run
>
>     sage DIPLOM.sagetex.sage`
>
> I get this:
>
>     
> /usr/lib/sagemath/local/lib/python2.7/site-packages/matplotlib/mathtext.py:887:
>  MathTextWarning: Font 'default' does not have a glyph for '\u043a' [U43a]
>       MathTextWarning)
>
> So I have garbage instead of russian symbols.
> How can I change a font name to use not only latin symbols?
you need to tell matplotlib to use another font. E.g.

sage: import matplotlib
sage: matplotlib.rc('font', **{'sans-serif' : 'Arial','family' : 'sans-serif'}) 
sage: list_plot(zip([1..5],[1..5])), True, color='blue', axes_labels=[u'$H,$ 
км',u'$\mu, c$'])

shows axis labels in cyrillic.
This works on OSX 10.6.8 -- you might need to use a different font on
your system.

To combine this with sagetex, you'd need to put 
import matplotlib
matplotlib.rc('font', **{'sans-serif' : 'Arial','family' : 'sans-serif'}) 
right after 
\begin{sagesilent}

HTH,
Dmitrii

>
> I could not find any information about this problem.
>
> (Personally I think it is a "bug". User should be able to use unicode out of 
> the box!)
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to