I try to use Hebrew characters in a Matlab figure plot on my Ubuntu to no avail. I tried:
text(0.6,0.5,'ירוק','fontname','times new roman','rotation',180,'fontsize',50,'color','r')
and
title('ירוק','fontname','times new roman','fontsize',50,'color','r')
similar to what was proposed in the answer to this question. I got garbled text (see attached image).
Matlab is in version R2009b. Of course I'm set to UTF-8 encoding.
>> slCharacterEncoding
ans =
UTF-8
I also have access to a remote computer via ssh, with version R2011a. That didn't work either. (There I had to slCharacterEncoding('UTF-8')
)
The other option, using a javax.swing.JLabel
component, is too difficult to use with the amount of graphing I have.
I can continue producing graphs with English axes and titles, but that's a pity. Any advice?
Edit: as suggested by Egon, if I can print -deps
and then replace the text (from code within Matlab) in the resulting EPS file, that's pretty cool too. But I don't know how to place Unicode in EPS and I think that's stretching it...
Yet another edit: I'm starting to think this is an X-server issue. Though different, I wouldn't be surprised if these issues are related:
- Matlab figure fonts: broken in 11.04 contd. here
- How to fix MATLAB small figures and small fonts in Ubuntu linux
- View Full Version : [ubuntu] huge fonts in matlab
I tried uninstalling Ubuntu supplied NVidia drivers (I have an 9300GS card) and re-installing NVidia supplied ones (v295). I tried changing DPI in xorg.conf to "100 x 100"
. Installed all packages listed in HebrewLocalizationHowto and then some. Nothing worked. Suggestions?
Another edit Fonts located under matlab/sys/fonts/ttf
or matlab/sys/fonts/type1
aren't rendered correctly. When I edit the figure and double click the title, I see the characters are there, but when I finish editing it returns to the bad rendering. Also, the JLabel solution for rendering Unicode characters suggested here renders text correctly under the same figure.
Another edit Matlab R2011a exhibits the same issue. Here's the output of listfonts
>> listfonts
ans =
'aharoni'
'andale mono'
'anka clm'
'arial'
'arial black'
'avant garde gothic'
'AvantGarde'
'batang'
'bitstream charter'
'biwidth'
'Bookman'
'caladings'
'century schoolbook l'
'charter'
'clean'
'clearlyu'
'clearlyu alternate glyphs'
'clearlyu arabic'
'clearlyu arabic extra'
'clearlyu devanagari'
'clearlyu devangari extra'
'clearlyu ligature'
'clearlyu pua'
'cmex10'
'cmmi10'
'cmr10'
'cmsy10'
'comic sans ms'
'comix no2 clm'
'Courier'
'courier 10 pitch'
'courier new'
'dingbats'
'dorian clm'
'dotum'
'drugulin'
'ellinia'
'fangsong ti'
'fixed'
'frank ruehl'
'gan clm'
'georgia'
'gladia clm'
'gothic'
'Helvetica'
'Helvetica-Narrow'
'impact'
'itc avant garde gothic'
'itc bookman'
'itc zapf chancery'
'itc zapf dingbats'
'ktav yad clm'
'latin modern roman'
'latin modern sans'
'latin modern sansquotation'
'latin modern typewriter'
'latin modern typewriter variable width'
'lucida'
'lucida bright'
'lucidabright'
'lucidasans'
'lucidasans typewriter'
'lucidatypewriter'
'mincho'
'msam10'
'msbm10'
'nachlieli'
'new century schoolbook'
'newcenturyschlbk'
'NewCenturySchoolBook'
'newspaper'
'nil'
'nimbus mono l'
'nimbus roman no9 l'
'nimbus sans l'
'open look cursor'
'open look glyph'
'ozrad clm'
'Palatino'
'song ti'
'standard symbols l'
'Symbol'
'terminal'
'texgyreadventor'
'texgyrebonum'
'texgyrecursor'
'texgyreheros'
'texgyrepagella'
'texgyreschola'
'texgyretermes'
'Times'
'times new roman'
'trebuchet ms'
'urw bookman l'
'urw chancery l'
'urw gothic l'
'urw palladio l'
'verdana'
'wasy10'
'webdings'
'yehuda'
'zapf chancery'
'zapf dingbats'
'ZapfChancery'
'ZapfDingbats'
'yehuda'
, since that sounds as if it should contain Hebrew letters. – Modie