Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Matplotlib russian fonts
-
Hi, Dear!
Please, help me!
I can't use russian fonts on the matplotlib in pithonista 3.*
Why?Best regards,
MK
-
Hi, welcome!
Someone else had a similar problem with Greek letters: https://forum.omz-software.com/topic/2594/matplotlib-unicode-greek-letters. Maybe the solutions there work for Russian text too.
-
Only rectangles instead of text :(
-
@aerokuzbass, this is how I managed to output Cyrillic characters in Matplotlib:
import sys import matplotlib.font_manager as fm if sys.platform.lower() == 'ios': fp = fm.FontProperties(fname = "/System/Library/Fonts/CoreAddition/Arial.ttf") elif sys.platform.lower() == 'darwin': # for macOS fp = fm.FontProperties(fname = '/Library/Fonts/Verdana.ttf') else: raise ValueError('Platform not supported:', sys.platform)
Then you do something like
matplotlib.pyplot.title("Привет, мир!", fontproperties=fp)
. So, basically, you only need to choose a font to use to display the characters. -
Thank You, Bro!