Re: [Matplotlib-users] display multi languages in a string.
That is correct. Matplotlib doesn't have font substitution support -- it only ever uses a single font for each text object. You will need to use separate text objects to do this kind of multi-lingual text, unless you can find a single font with all of the glyphs. Mike On 11/24/2010 10:19 PM, honglei junan wrote: i get matplotlib from Sourceforge ,it's matplotlib-1.0.0.win32-py2.6.exe OS:Win7 ActivePython-2.6.6.15-win32-x86.msi here is the code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt plt.figure(figsize=(8,4)) a = plt.text(0.05, 0.05, uDefault Font缺省字体조선어にほんごภาษา ไทย)#multi language ,some cann't display plt.text(0.05, 0.45, uMicrosoft YaHei微软雅黑, fontproperties='Microsoft YaHei')#Chinese OK plt.text(0.05, 0.25, uLilyUPCภาษาไทย, fontproperties='LilyUPC')#Tai OK plt.xlabel(uxlabelにほん ご,fontproperties='STXihei')#Japanese ,OK plt.ylabel(uylabel조선 어,fontproperties='Malgun Gothic')#Korea,OK plt.show() C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc: font.family : sans-serif font.sans-serif : Microsoft YaHei,Malgun Gothic,LilyUPC,FangSong,YouYuan,SimHei,STKaiti,STSong,SimSun-ExtB,Webdings,Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif it seems if a default font doesn't have all char's in the Default Font缺省字体조선어にほんごภาษาไทย string,it won't display correctly. -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] display multi languages in a string.
Unfortunately, matplotlib does not support fontset, and only a single font file can be used at a time. If you need to to use multiple fonts within a single text string, the only workaround I can think of is to use the offsetbox module to make a text for each font and concatenate them. If you're interested, I'll post the code. -JJ On Thu, Nov 25, 2010 at 12:19 PM, honglei junan jhong...@gmail.com wrote: i get matplotlib from Sourceforge ,it's matplotlib-1.0.0.win32-py2.6.exe OS:Win7 ActivePython-2.6.6.15-win32-x86.msi here is the code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt plt.figure(figsize=(8,4)) a = plt.text(0.05, 0.05, uDefault Font缺省字体조선어にほんごภาษาไทย)#multi language ,some cann't display plt.text(0.05, 0.45, uMicrosoft YaHei微软雅黑, fontproperties='Microsoft YaHei')#Chinese OK plt.text(0.05, 0.25, uLilyUPCภาษาไทย, fontproperties='LilyUPC')#Tai OK plt.xlabel(uxlabelにほんご,fontproperties='STXihei')#Japanese ,OK plt.ylabel(uylabel조선어,fontproperties='Malgun Gothic')#Korea,OK plt.show() C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc: font.family : sans-serif font.sans-serif : Microsoft YaHei,Malgun Gothic,LilyUPC,FangSong,YouYuan,SimHei,STKaiti,STSong,SimSun-ExtB,Webdings,Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif it seems if a default font doesn't have all char's in the Default Font缺省字体조선어にほんごภาษาไทย string,it won't display correctly. -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] display multi languages in a string.
i get matplotlib from Sourceforge ,it's matplotlib-1.0.0.win32-py2.6.exe OS:Win7 ActivePython-2.6.6.15-win32-x86.msi here is the code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt plt.figure(figsize=(8,4)) a = plt.text(0.05, 0.05, uDefault Font缺省字体조선어にほんごภาษาไทย)#multi language ,some cann't display plt.text(0.05, 0.45, uMicrosoft YaHei微软雅黑, fontproperties='Microsoft YaHei')#Chinese OK plt.text(0.05, 0.25, uLilyUPCภาษาไทย, fontproperties='LilyUPC')#Tai OK plt.xlabel(uxlabelにほんご,fontproperties='STXihei')#Japanese ,OK plt.ylabel(uylabel조선어,fontproperties='Malgun Gothic')#Korea,OK plt.show() C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc: font.family : sans-serif font.sans-serif : Microsoft YaHei,Malgun Gothic,LilyUPC,FangSong,YouYuan,SimHei,STKaiti,STSong,SimSun-ExtB,Webdings,Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif it seems if a default font doesn't have all char's in the Default Font缺省字体조선어にほんごภาษาไทย string,it won't display correctly. -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users