Re: [Matplotlib-users] tick line formatting
Hi Uri, AFAI, in matplotlibrc you have : ### TICKS # see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks #xtick.direction : in # direction: in or out #ytick.direction : in # direction: in or out Hope it helps. Mathieu. On Tue, Aug 26, 2008 at 11:35 PM, Uri Laserson [EMAIL PROTECTED] wrote: Hi, Is it possible to create tick marks that go outwards (i.e., point towards the label) rather than inwards? Thanks! Uri -- Uri Laserson PhD Candidate, Biomedical Engineering Harvard Medical School (Genetics) Massachusetts Institute of Technology (Mathematics) phone +1 917 742 8019 [EMAIL PROTECTED] - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] axis formatting
Uri, You could look have a look at : gca().xaxis.tick_bottom() gca().yaxis.tick_left() or hide the frame : ax = axes( FrameOne=False ) Hope this helps. On Tue, Aug 26, 2008 at 11:35 PM, Uri Laserson [EMAIL PROTECTED] wrote: Hi, Is it possible to create plots that only have a single x-axis on the bottom and a single y-axis on the left, while suppressing an upper or right axis (i.e., have the graph be open)? Thanks! Uri -- Uri Laserson PhD Candidate, Biomedical Engineering Harvard Medical School (Genetics) Massachusetts Institute of Technology (Mathematics) phone +1 917 742 8019 [EMAIL PROTECTED] - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG backend fails with locale change
On Mon, Aug 25, 2008 at 7:17 PM, Michael Droettboom [EMAIL PROTECTED] wrote: Thanks for spotting this. I don't think a lot of us ever use non-English locales, so that's fallen through the cracks. backend_svg.py was using '%s' to convert floats, to limit the number of digits written to the file. This works fine with regular floats (since they do not follow the locale unless explicitly asked to do so), but numpy arrays seem to always follow the locale. (Not certain whether that inconsistency could be considered a bug in Numpy). In any case, I've committed a workaround to matplotlib, which unfortunately results in slightly larger SVG files. This is now fixed in SVN r6049. Look there for a patch if you just want to fix your local backend_svg.py. Thanks for your lightspeed fix submit ! I patched it and it works fine. Mathieu. Cheers, Mike Mathieu Leplatre wrote: Hi, If I change the locale using cairo backend, the result is fine. But with SVG backend, every objects collapse on top-left corner. As you can see here : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.svg I exported it to png with inkscape to reveal objects outside of frame : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.png Cairo output is fine : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-cairo.svg I guess it's not a unicode problem, since the strings have no non-ascii characters. The code is quite straightforward, it allows me to choose the date language for the formatters. Let me know if I should fill a bug report. Thank you all ! import locale, matplotlib from datetime import datetime matplotlib.use('svg') import pylab, numpy locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') today = datetime.today().strftime(%A) pylab.title( today ) pylab.plot( range(10), numpy.random.randn( 10 )) pylab.savefig('localechange-%s' % matplotlib.get_backend()) - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] SVG backend fails with locale change
Hi, If I change the locale using cairo backend, the result is fine. But with SVG backend, every objects collapse on top-left corner. As you can see here : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.svg I exported it to png with inkscape to reveal objects outside of frame : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-svg.png Cairo output is fine : http://mathieu-leplatre.info/media/matplotlib-svg/localechange-cairo.svg I guess it's not a unicode problem, since the strings have no non-ascii characters. The code is quite straightforward, it allows me to choose the date language for the formatters. Let me know if I should fill a bug report. Thank you all ! import locale, matplotlib from datetime import datetime matplotlib.use('svg') import pylab, numpy locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') today = datetime.today().strftime(%A) pylab.title( today ) pylab.plot( range(10), numpy.random.randn( 10 )) pylab.savefig('localechange-%s' % matplotlib.get_backend()) - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Automatically make room for my tick labels without GUI ?
Hi all, I am trying to automatically adjust margins with the SVG backend. The FAQ example : http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-automatically-make-room-for-my-tick-labels only works with GUI backends. May it come from get_window_extent() call ? How could I modify this snipplet so that it works with SVG (or PDF) backends ? Thank you for your support. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Automatic margins
On Fri, Aug 15, 2008 at 1:52 PM, Mathieu Leplatre [EMAIL PROTECTED] wrote: There is a FAQ showing how to do this for tick labels using the bounding boxes of the labels. You could do something similar with the title bounding box http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-automatically-make-room-for-my-tick-labels JDH Thank you very much for pointing me this out. I must confess I hadn't seen it. I am trying to modify the given snipplet so that it could work with something more general like : for label in fig.findobj(matplotlib.text.Text): Apart from the missing renderer exceptions that are raised, I can't figure out how to split the resulting union box into left, right, bottom, top as required by fig.subplots_adjust() If this is obvious, I am very sorry to be tiresome... Thanks a lot for your help. I figured it out, just had to test xmin/ymin 0.0 and xmax/ymax 1.0. I could compute easily the new margins values and it works well. *However*, I noticed that the SVG renderer does not take in account the self.fig.subplots_adjust() commands called within on_draw(self, event). The FAQ example mentionned above does not work when invoking matplotlib.use(svg). I am using matplotlib 0.98.3, it could be a bug ? Thanks for your feedback ! (should I start a new thread ?) - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Automatic margins
There is a FAQ showing how to do this for tick labels using the bounding boxes of the labels. You could do something similar with the title bounding box http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-automatically-make-room-for-my-tick-labels JDH Thank you very much for pointing me this out. I must confess I hadn't seen it. I am trying to modify the given snipplet so that it could work with something more general like : for label in fig.findobj(matplotlib.text.Text): Apart from the missing renderer exceptions that are raised, I can't figure out how to split the resulting union box into left, right, bottom, top as required by fig.subplots_adjust() If this is obvious, I am very sorry to be tiresome... Thanks a lot for your help. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Control space between bars
Hi all, I've searched in examples and archives and could not find anything about manual control of space between bars. By default, the bars in the following script overlap. So I guess the behaviour is : specify chart width (8in) + bar width (0.8) = auto bar space And I would like to know how to do : specify chart width + bar space = auto bar width specify bar space + bar width = auto chart width (fixed margins) But I can't figure it out, especially the latter. Can matplotlib.transforms help me about the former ? Do you have documentation reference or some hints about that please ? Thanks! I am plotting a chronological bar chart like this one : #!/usr/bin/env python import matplotlib, pylab, numpy import datetime def rangedates( hourstep ): dates = [] for d in range(1,31): for h in range(0,24,hourstep): dt = datetime.datetime(2008,06,d,h) dates.append(dt) return pylab.date2num(dates) # Plot value every 12H abscissa = rangedates(12) barstep = abscissa[1] - abscissa[0] barspace = 0.5 * barstep barwidth = barstep - barspace fig = pylab.figure() ax = fig.add_subplot(111) fmt = matplotlib.dates.DateFormatter('%b %d') ax.xaxis.set_major_formatter( fmt ) fig.autofmt_xdate() pylab.bar( abscissa, numpy.random.randn( len(abscissa) ), width = barwidth) pylab.show() - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG rendering problems
Can you send your SVG files (or the scripts that generate them) to this list so I can look at why they may be failing? Screenshots or PNGs from ImageMagick and/or eog may also be useful, in case I can't reproduce the problems with the versions I have here. Mike, do you want them as attachment in this list ? I put them on my webserver : http://mathieu-leplatre.info/media/matplotlib-svg/ (can't give you easily the script that generates them, it's a whole software...) I wanted your opinion before insisting on CentOS forums/mailing-lists. Thanks for your patience. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] SVG rendering problems
Hi all, With both matplotlib versions (0.91 and 0.98), my SVGs are rendered correctly in Inkscape (and almost well in Firefox), but they are not rendered correctly when viewed with ImageMagick or Eye-of-Gnome. I did screenshots here, showing this curve cropping issue : http://mathieu-leplatre.info/media/matplotlib-svg/ I am running CentOS 5.2 with matplotlib compiled manually in both cases. Cairo 1.2.4, librsvg 2.16, inkscape 0.46 Could it be related to matplotlib ? Or to operating system libraries ? Thank you all for your support. Mathieu. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Arabic Character Support
Thank you Michael and Darren. I'll keep your information for further polishing : So far, I am not having problems with my two-steps solution : 1) SVG backend 2) rsvg + Cairo, code snippet : svg = rsvg.Handle( filesvg ) width = svg.props.width height = svg.props.height surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, width, height) cr = cairo.Context (surface) svg.render_cairo (cr) surface.write_to_png (filepng) Thanks again for your assistance ! Long live sub-cultures and their exotic writings ! 2008/6/25 Mathieu Leplatre [EMAIL PROTECTED]: Well, I'll give a try towards another possibility : 1 - use SVG output with rc setting : svg.embed_char_paths to False 2 - use cairo to export to PNG/JPG etc.. Step 1 works great natively with Arabic (at least viewing it with Inkscape). Let's see if I have problems with step 2. 2008/6/25 Darren Dale [EMAIL PROTECTED]: Hi Mathieu, Are there perhaps some latex packages you could load using the text.latex.preamble rc setting? This setting is officially unsupported, but it would be much easier than adding an option to use the xetex executable (which would probably not be officially supported by mpl). Darren On Wednesday 25 June 2008 09:02:41 am Mathieu Leplatre wrote: Hi all, I have been trying to follow your tips regarding matplotlib and arabic support. Indeed matplotlib with Latex and unicode work great together : #-*- coding: utf-8 -*- from pylab import * from matplotlib import rcParams rcParams['text.usetex']=True rcParams['text.latex.unicode']=True figure(1) plot([1,2,3]) title(unicode(r'\textit{éèê}','utf8')) show() But then I came to the conclusion that Latex did not support Arabic. This few lines generate a missing def error. \documentclass{article} \usepackage{ucs} \usepackage[utf8x]{inputenc} \title{éèê هه} \begin{document} \maketitle \end{document} Is it related to my installation ? (Ubuntu with package texlive-latex-recommended) I asked here : http://ubuntuforums.org/showthread.php?p=5258457 Somebody pointed me out XeTeX, which has wider support for Unicode. www.tug.org/TUGboat/Articles/tb27-2/tb87kew.pdf I was wondering if there could be a way to get matplotlib work with XeTeX. What do you think ? Is it the right track ? Should I switch to grandpa's gnuplot :) ? Thank you all, Mathieu. Michael Droettboom wrote: Unfortunately, I believe this is a fundamental incompatibility within matplotlib. matplotlib uses a very simple algorithm for layout out a line of characters which assumes ltr order and all kinds of other things. That said, there is something you could try. Matplotlib has a usetex mode which will do all text rendering using LaTeX. Assuming you can get LaTeX to handle Arabic correctly, you can set the following in your .matplotlibrc file: text.usetex : True text.latex.unicode : True You'll need to install the LaTeX Unicode extension ucs (Ubuntu probably has packages for that.) If you need to load any LaTeX packages to get arabic support, you can tell matplotlib about them in your matplotlibrc like so: text.latex.preamble: \usepackage{foo} If Arabic-encoded-as-Unicode doesn't work, you could try setting text.latex.unicode to False, and then typing your Arabic strings using one of the other Arabic encodings that LaTeX understands. Please let us know if you have success or hit another roadblock. Cheers, Mike Burhan Khalid wrote: Hello All: Having an issue with Arabic font support using matplotlib. When using the correct font, Arabic characters are displayed, but are not joined together properly; and they are also not in the correct order (the font rendered is ltr, but Arabic is a rtl language). Is this an issue with the render I am using, or some incompatibility within matplotlib? Sample source code used (please note, your email client should support utf8 to display the code correctly). #-*- coding: utf-8 -*- from pylab import * figure(1) # the first figure plot([1,2,3]) figure(1) # figure 1 current title(u'برهان',name='Times New Roman') # figure 1 title savefig('test.png') savefig('test.eps') show() Output when run from the command line: matplotlib data path /usr/share/matplotlib/mpl-data $HOME=/home/burhan CONFIGDIR=/home/burhan/.matplotlib loaded rc file /etc/matplotlibrc matplotlib version 0.90.1 verbose.level helpful interactive is False units is True platform is linux2 numerix numpy 1.0.3 font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf', '/usr/share/matplotlib/mpl-data/fonts/afm'] loaded ttfcache file /home/burhan/.matplotlib/ttffont.cache backend TkAgg version 8.4 Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif, normal, normal. Returning /usr/share/fonts/truetype/ttf
Re: [Matplotlib-users] Arabic Character Support
Hi all, I have been trying to follow your tips regarding matplotlib and arabic support. Indeed matplotlib with Latex and unicode work great together : #-*- coding: utf-8 -*- from pylab import * from matplotlib import rcParams rcParams['text.usetex']=True rcParams['text.latex.unicode']=True figure(1) plot([1,2,3]) title(unicode(r'\textit{éèê}','utf8')) show() But then I came to the conclusion that Latex did not support Arabic. This few lines generate a missing def error. \documentclass{article} \usepackage{ucs} \usepackage[utf8x]{inputenc} \title{éèê هه} \begin{document} \maketitle \end{document} Is it related to my installation ? (Ubuntu with package texlive-latex-recommended) I asked here : http://ubuntuforums.org/showthread.php?p=5258457 Somebody pointed me out XeTeX, which has wider support for Unicode. www.tug.org/TUGboat/Articles/tb27-2/tb87kew.pdf I was wondering if there could be a way to get matplotlib work with XeTeX. What do you think ? Is it the right track ? Should I switch to grandpa's gnuplot :) ? Thank you all, Mathieu. Michael Droettboom wrote: Unfortunately, I believe this is a fundamental incompatibility within matplotlib. matplotlib uses a very simple algorithm for layout out a line of characters which assumes ltr order and all kinds of other things. That said, there is something you could try. Matplotlib has a usetex mode which will do all text rendering using LaTeX. Assuming you can get LaTeX to handle Arabic correctly, you can set the following in your .matplotlibrc file: text.usetex : True text.latex.unicode : True You'll need to install the LaTeX Unicode extension ucs (Ubuntu probably has packages for that.) If you need to load any LaTeX packages to get arabic support, you can tell matplotlib about them in your matplotlibrc like so: text.latex.preamble: \usepackage{foo} If Arabic-encoded-as-Unicode doesn't work, you could try setting text.latex.unicode to False, and then typing your Arabic strings using one of the other Arabic encodings that LaTeX understands. Please let us know if you have success or hit another roadblock. Cheers, Mike Burhan Khalid wrote: Hello All: Having an issue with Arabic font support using matplotlib. When using the correct font, Arabic characters are displayed, but are not joined together properly; and they are also not in the correct order (the font rendered is ltr, but Arabic is a rtl language). Is this an issue with the render I am using, or some incompatibility within matplotlib? Sample source code used (please note, your email client should support utf8 to display the code correctly). #-*- coding: utf-8 -*- from pylab import * figure(1) # the first figure plot([1,2,3]) figure(1) # figure 1 current title(u'برهان',name='Times New Roman') # figure 1 title savefig('test.png') savefig('test.eps') show() Output when run from the command line: matplotlib data path /usr/share/matplotlib/mpl-data $HOME=/home/burhan CONFIGDIR=/home/burhan/.matplotlib loaded rc file /etc/matplotlibrc matplotlib version 0.90.1 verbose.level helpful interactive is False units is True platform is linux2 numerix numpy 1.0.3 font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf', '/usr/share/matplotlib/mpl-data/fonts/afm'] loaded ttfcache file /home/burhan/.matplotlib/ttffont.cache backend TkAgg version 8.4 Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif, normal, normal. Returning /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf This is on a clean Ubuntu Gutsy install, using python 2.5.1. Thanks, Burhan - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net
Re: [Matplotlib-users] Arabic Character Support
Well, I'll give a try towards another possibility : 1 - use SVG output with rc setting : svg.embed_char_paths to False 2 - use cairo to export to PNG/JPG etc.. Step 1 works great natively with Arabic (at least viewing it with Inkscape). Let's see if I have problems with step 2. 2008/6/25 Darren Dale [EMAIL PROTECTED]: Hi Mathieu, Are there perhaps some latex packages you could load using the text.latex.preamble rc setting? This setting is officially unsupported, but it would be much easier than adding an option to use the xetex executable (which would probably not be officially supported by mpl). Darren On Wednesday 25 June 2008 09:02:41 am Mathieu Leplatre wrote: Hi all, I have been trying to follow your tips regarding matplotlib and arabic support. Indeed matplotlib with Latex and unicode work great together : #-*- coding: utf-8 -*- from pylab import * from matplotlib import rcParams rcParams['text.usetex']=True rcParams['text.latex.unicode']=True figure(1) plot([1,2,3]) title(unicode(r'\textit{éèê}','utf8')) show() But then I came to the conclusion that Latex did not support Arabic. This few lines generate a missing def error. \documentclass{article} \usepackage{ucs} \usepackage[utf8x]{inputenc} \title{éèê هه} \begin{document} \maketitle \end{document} Is it related to my installation ? (Ubuntu with package texlive-latex-recommended) I asked here : http://ubuntuforums.org/showthread.php?p=5258457 Somebody pointed me out XeTeX, which has wider support for Unicode. www.tug.org/TUGboat/Articles/tb27-2/tb87kew.pdf I was wondering if there could be a way to get matplotlib work with XeTeX. What do you think ? Is it the right track ? Should I switch to grandpa's gnuplot :) ? Thank you all, Mathieu. Michael Droettboom wrote: Unfortunately, I believe this is a fundamental incompatibility within matplotlib. matplotlib uses a very simple algorithm for layout out a line of characters which assumes ltr order and all kinds of other things. That said, there is something you could try. Matplotlib has a usetex mode which will do all text rendering using LaTeX. Assuming you can get LaTeX to handle Arabic correctly, you can set the following in your .matplotlibrc file: text.usetex : True text.latex.unicode : True You'll need to install the LaTeX Unicode extension ucs (Ubuntu probably has packages for that.) If you need to load any LaTeX packages to get arabic support, you can tell matplotlib about them in your matplotlibrc like so: text.latex.preamble: \usepackage{foo} If Arabic-encoded-as-Unicode doesn't work, you could try setting text.latex.unicode to False, and then typing your Arabic strings using one of the other Arabic encodings that LaTeX understands. Please let us know if you have success or hit another roadblock. Cheers, Mike Burhan Khalid wrote: Hello All: Having an issue with Arabic font support using matplotlib. When using the correct font, Arabic characters are displayed, but are not joined together properly; and they are also not in the correct order (the font rendered is ltr, but Arabic is a rtl language). Is this an issue with the render I am using, or some incompatibility within matplotlib? Sample source code used (please note, your email client should support utf8 to display the code correctly). #-*- coding: utf-8 -*- from pylab import * figure(1) # the first figure plot([1,2,3]) figure(1) # figure 1 current title(u'برهان',name='Times New Roman') # figure 1 title savefig('test.png') savefig('test.eps') show() Output when run from the command line: matplotlib data path /usr/share/matplotlib/mpl-data $HOME=/home/burhan CONFIGDIR=/home/burhan/.matplotlib loaded rc file /etc/matplotlibrc matplotlib version 0.90.1 verbose.level helpful interactive is False units is True platform is linux2 numerix numpy 1.0.3 font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf', '/usr/share/matplotlib/mpl-data/fonts/afm'] loaded ttfcache file /home/burhan/.matplotlib/ttffont.cache backend TkAgg version 8.4 Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif, normal, normal. Returning /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf This is on a clean Ubuntu Gutsy install, using python 2.5.1. Thanks, Burhan - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com