Jan Strube | 1 Oct 02:32
Picon

Re: xticks vs yticks

Sorry, reposting, because I sent it from the wrong address.

I'm having some problems understanding the difference between pylab.xticks() and pylab.yticks()
Consider the following:
import pylab as P
import numpy as N

data = N.random.random((10, 10))
P.matshow(data)
P.xticks([0, 1, 2], ['1', '2', '3'])
P.show()

Why does this work, but if I change P.xticks to P.yticks, it doesn't?

The error message that I get back doesn't give me any insight as to what could cause the difference between xticks and yticks.

 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/figure.py", line 612, in draw
    for a in self.axes: a.draw(renderer)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py", line 1287, in draw
    self.transData.freeze()  # eval the lazy objects
ValueError: Domain error on eval_scalars in Transformation::freeze


 matplotlib.__version__
Out[2]: '0.90.1'

I am still in the learning phase, so any insight as to what's going on is appreciated.

Best,
    Jan




--
Jan Strube -- University of Oregon
Stanford Linear Accelerator Center
Bldg. 48
phone: (650) 926-2913
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jan Strube | 1 Oct 03:25
Picon

doc bug

It appears that IndexFormatter is no longer in ticker.py as the user guide (Table 6.3, p.58) suggests.

Cheers,
    Jan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Lee, Young-Jin | 1 Oct 08:49
Picon

Re: multiple figures interactively

Folks, I need your help. I'll explain a little further what happens.
Following is a test program,'test.py', and screen shot of the error
message. Here, 'test.py' is simple chart of sinusoidal function in
http://matplotlib.sourceforge.net/screenshots.html (simple_plot.py), but
have two of them in series. I tried Wolfgang's suggestion but it doesn't
help. Any idea?

Test.py:

from pylab import *

t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s, linewidth=1.0)

xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()

clf()
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s, linewidth=1.0)

xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()

Execution of test.py:

c:\Python24>python test.py
c:\Python24\lib\site-packages\matplotlib\numerix\__init__.py:53:
DeprecationWarn
ing: numarray use as a numerix backed for matplotlib is deprecated
  DeprecationWarning, stacklevel=1)
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

c:\Python24>

-----Original Message-----
From: Wolfgang Kerzendorf [mailto:wkerzendorf@...] 
Sent: Wednesday, September 26, 2007 9:03 PM
To: Lee, Young-Jin
Cc: matplotlib-users@...
Subject: Re: [Matplotlib-users] multiple figures interactively

This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I 'm writing a python program that draws figures one by one 
> interactively with the user's input in dos mode. Basically, I give the

> program a decision after each figure and then it draws the next one. 
> After the first figure, it got very much slowed down for the second 
> one and crashed for the third one. I feel like it has some memory 
> issues as I keep using 'show' after I close each. I used 'clf()' 
> before I draw a new one, but it doesn't seem to help. Any idea?
Thanks.
>
> Young Jin
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Eric Firing | 1 Oct 09:19
Favicon
Gravatar

Re: xticks vs yticks

Jan Strube wrote:
> Sorry, reposting, because I sent it from the wrong address.
> 
>     I'm having some problems understanding the difference between
>     pylab.xticks() and pylab.yticks()
>     Consider the following:
> 
>         import pylab as P
>         import numpy as N
> 
>         data = N.random.random((10, 10))
>         P.matshow(data)
>         P.xticks([0, 1, 2], ['1', '2', '3'])
>         P.show()
> 
> 
>     Why does this work, but if I change P.xticks to P.yticks, it doesn't?

This is now fixed in svn 3904.  The problem was not related to x versus 
y but was caused by incorrect handling of the reversed y axis (positive 
down instead of positive up).  If the x axis were the reversed one, the 
same problem would occur.

> 
>     The error message that I get back doesn't give me any insight as to
>     what could cause the difference between xticks and yticks.

Yes, it is one of those infamous error messages from the extension code 
in the transforms module.
> 
>      File
>     "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/figure.py",
>     line 612, in draw
>         for a in self.axes: a.draw(renderer)
>       File
>     "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
>     line 1287, in draw
>         self.transData.freeze()  # eval the lazy objects
>     ValueError: Domain error on eval_scalars in Transformation::freeze

It is probably a divide-by-zero error; but the real bug was elsewhere in 
the extension code, where the y-data-interval was erroneously set to 
zero when you tried to set the ticks.

> 
> 
>      matplotlib.__version__
>     Out[2]: '0.90.1'
> 
>     I am still in the learning phase, so any insight as to what's going
>     on is appreciated.
> 
>     Best,
>         Jan

Thanks for the good bug report, or more precisely, the good report of a 
bad bug.

I dimly recall some other email recently--maybe on 
matplotlib-devel--that may have been related.  I think it was advocating 
a different method of keeping track of reversed axes.  Maybe it was 
prompted by encountering the same problem you ran into.

Eric

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Michael Droettboom | 1 Oct 13:34

Re: Using special characters

We can first try to track down whether the Arial MS Unicode font is 
getting picked up.  In your matplotlibrc, can you add:

   verbose: debug-annoying

and send the output of your plot to the list?  You'll see where it looks 
up the font and whether that lookup failed or not.

There have been a number of Unicode-related fixes in SVN since the 
0.90.1 release -- though most were in the PDF backend, not PS.  One 
thing to try (don't know offhand whether it's working better or not) may 
be to use the Cairo backend to generate the PS and then use ps2epsi to 
get an EPS.

Cheers,
Mike

David Loyall wrote:
> Hello.
> 
> I've been having trouble getting Unicode characters to render.  I just
> get a box in the title of my figure, rather than the character I need.
> 
> Here is my code:
> #!/usr/bin/env python
> from pylab import *
> plot([1,2,3,4])
> title(u"\u0251")
> savefig("test.eps")
> savefig("test.png")
> show()
> 
> That character is LATIN SMALL LETTER ALPHA.  It's used in the
> International Phonetic Alphabet.
> 
> I'm on Linux and I'm using matplotlib 0.90.1-2 (debian package
> version).  I have a few TTF fonts in my system that contain that
> glyph.  One is 'Arial Unicode MS', which I copied from my windows
> machine.
> 
> As you can see, I will need to generate an EPS that renders the
> character...  That EPS file will be imported into MS Word on a Windows
> PC and printed.
> 
> I will happily use any solution that allows me to use that character
> in the final product... :)  It doesn't have to be unicode..
> 
> I believe that my fonts are configured correctly on this Linux
> system--I can use the Arial Unicode MS font in Open Office.  However,
> I'm not sure that MPL is finding them.
> 
> When I point the TTFPATH environment variable a directory that only
> contains ARIALUNI.TTF, I get gibberish for all characters in my
> figure.
> 
> When I use ~/.matplotlib/matplotlibrc to list Arial Unicode MS as the
> only font in the san-serif family, I don't observe any change in the
> text in the figure.
> 
> ...I did successfully instantiate an FT2FONT object out of my
> ARIALUNI.TTF file, but, I didn't know what to do with it at that
> point.
> 
> Help?
> 
> Cheers,
> --Dave Loyall
> Omaha, Nebraska, USA
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> 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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
David Loyall | 1 Oct 14:49

Re: Using special characters

On 10/1/07, Michael Droettboom <mdroe@...> wrote:
> We can first try to track down whether the Arial MS Unicode font is
> getting picked up.  In your matplotlibrc, can you add:
>
>    verbose: debug-annoying

Michael,

Thank you.  Interesting results:

With verbose.level set to debug-annoying, these lines look significant:
       findfont failed Arial Unicode MS, normal, normal 500, normal, 14.0
Could not match Arial Unicode MS, normal, normal.  Returning
/usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf

Well, I played around with this a little more and found the problem!
The font.weight of 'medium' (500) is what could not be found.  When I
switched font.weight to 'normal' (400) in matplotlibrc, it worked and
the graph was rendered with the correct glyph.  (This worked for the
DejaVu Sans font, still no luck with Arial Unicode MS, but, that's
fine.)

So, problem solved, thanks again! :)

Here's something I noticed:  When I copied ARIALUNI.TTF into
/usr/share/matplotlib/mpl-data/fonts/ttf/ and ran the test plot, all
the characters are gibberish.  Actually, they are glyphs, but, the
wrong ones.  The same thing happens if I copy Thyromanes .ttf files
into that directory, or if I put those files in the $TTFPATH
directory.  In fact, it also happens if I copy andalemo.ttf, and that
font doesn't include extra unicode characters.

So, I'll paste the entire debug-annoying output that occurred when I
was getting the gibberish text on the plot at the end of this email.
As you can see, I set the font to a nonsense string to illustrate that
the problem occurs even if the extra font in the directory isn't being
requested.  Also, I made sure that the extra font wasn't duplicated
anywhere else in the search path.

Cheers,
--Dave Loyall

loaded rc file /home/hobbes/.matplotlib/matplotlibrc
matplotlib version 0.90.1
verbose.level debug-annoying
interactive is False
units is False
platform is linux2
loaded modules: ['_bisect', 'distutils', 'pylab', 'datetime',
'matplotlib.tempfile', 'distutils.sysconfig', 'pytz.datetime',
'pytz.cStringIO', 'struct', 'tempfile', 'imp', 'pytz.os', 'zipimport',
'string', 'encodings.utf_8', 'matplotlib.__future__', 'pytz.tzinfo',
'distutils.re', 'bisect', 'signal', 'random', 'token',
'matplotlib.pytz', 'dis', 'pytz.tzfile', 'cStringIO', 'locale',
'encodings', 'dateutil', 'matplotlib.warnings', 'pytz.pytz',
'matplotlib.sys', 're', 'math', 'fcntl', 'UserDict', 'inspect',
'distutils.os', 'matplotlib', 'codecs', 'md5', '_locale',
'matplotlib.os', 'thread', 'sre', 'itertools', 'opcode',
'distutils.sys', 'os', '__future__', '_sre', '__builtin__',
'matplotlib.re', 'distutils.string', 'matplotlib.datetime',
'posixpath', 'errno', 'binascii', 'sre_constants', 'matplotlib.md5',
'types', 'pytz.sys', 'tokenize', '_codecs', 'pytz', 'copy',
'matplotlib.dateutil', 'posix', 'encodings.aliases', 'exceptions',
'sre_parse', 'pytz.bisect', 'copy_reg', 'sre_compile', '_random',
'pytz.struct', 'site', '__main__', 'shutil', 'strop',
'encodings.codecs', 'gettext', 'encodings.exceptions', 'pytz.sets',
'stat', 'warnings', 'encodings.types', 'sys', 'os.path',
'pytz.gettext', 'matplotlib.distutils', 'distutils.errors',
'linecache', 'matplotlib.shutil', 'sets']
numerix numpy 1.0.3
font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf',
'/usr/share/matplotlib/mpl-data/fonts/afm']
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmr10.ttf
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf
trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/ARIALUNI.TTF
trying fontname /usr/share/fonts/truetype/ttf-sil-padauk/Padauk-Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanai.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSerif.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevG.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightRegular.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Bold.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSerifBold.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevE.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiab.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSansOblique.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevC.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiItalic.ttf
trying fontname
/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Italic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-BoldOblique.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/andalemo.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/arialbi.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevB.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansOblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Oblique.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/cour.ttf
trying fontname
/usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBoldOblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryrg__.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldItalic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/courbd.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS.ttf
trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thrybi__.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Italic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/comicbd.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightItalic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/courbi.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/times.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/georgia.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/trebuc.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSansBold.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeMonoBold.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-ExtraLight.ttf
trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Regular.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanaz.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiai.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Italic.ttf
trying fontname /usr/share/fonts/truetype/kochi/kochi-mincho.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/couri.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-BoldItalic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/ariblk.ttf
trying fontname /usr/share/fonts/truetype/openoffice/opens___.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevD.ttf
trying fontname
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Italic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Black.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Webdings.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterOblique.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-padauk/Padauk.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf
trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Italic.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSans.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/ariali.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucbi.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/timesi.ttf
trying fontname
/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiBold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiaz.ttf
trying fontname
/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryb___.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/timesbd.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/verdana.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/arial.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/comic.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/webdings.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucit.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/timesbi.ttf
trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryi___.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/impact.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanab.ttf
trying fontname
/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold_Italic.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiOblique.ttf
trying fontname /usr/share/fonts/truetype/kochi/kochi-mincho-subst.ttf
trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-BoldItalic.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeMono.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucbd.ttf
trying fontname /usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterRegular.ttf
trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiBold.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevA.ttf
trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevF.ttf
trying fontname /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
$HOME=/home/hobbes
CONFIGDIR=/home/hobbes/.matplotlib
loaded ttfcache file /home/hobbes/.matplotlib/ttffont.cache
matplotlib data path /usr/share/matplotlib/mpl-data
Could not load matplotlib icon: Couldn't recognize the image file
format for file '/usr/share/matplotlib/mpl-data/images/matplotlib.svg'
backend GTKAgg version 2.10.6
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=640.0,                         height=480.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
RendererAgg._get_agg_font
	findfont failed FOOFOOFOO
Could not match FOOFOOFOO, normal, normal.  Returning
/usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
	findfont failed FOOFOOFOO, normal, normal 400, normal, 14.0
Could not match FOOFOOFOO, normal, normal.  Returning
/usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
FigureCanvasAgg.buffer_rgba
RendererAgg.buffer_rgba

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Michael Droettboom | 1 Oct 15:05

Re: Using special characters

David Loyall wrote:
> On 10/1/07, Michael Droettboom <mdroe@...> wrote:
>> We can first try to track down whether the Arial MS Unicode font is
>> getting picked up.  In your matplotlibrc, can you add:
>>
>>    verbose: debug-annoying
> 
> Michael,
> 
> Thank you.  Interesting results:
> 
> With verbose.level set to debug-annoying, these lines look significant:
>        findfont failed Arial Unicode MS, normal, normal 500, normal, 14.0
> Could not match Arial Unicode MS, normal, normal.  Returning
> /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
> 
> Well, I played around with this a little more and found the problem!
> The font.weight of 'medium' (500) is what could not be found.  When I
> switched font.weight to 'normal' (400) in matplotlibrc, it worked and
> the graph was rendered with the correct glyph.  (This worked for the
> DejaVu Sans font, still no luck with Arial Unicode MS, but, that's
> fine.)
> 
> So, problem solved, thanks again! :)

Great to know the problem is solved in your particular instance.  In 
general, though, the font-finding algorithm is being a bit too strict. 
Currently there's no sense of "weighting of properties" in the way it 
looks up fonts -- it should probably do something to the effect that a 
match of the name is more important than a match in the weight.  As it 
stands now, if it doesn't find an exact match it throws up its hands and 
just grabs the first available font...  There is some experimental 
support for using fontconfig (the more-or-less standard way to look up 
fonts on Linux these days) in SVN of matplotlib -- hopefully by the next 
release some of these things will be worked out.

> Here's something I noticed:  When I copied ARIALUNI.TTF into
> /usr/share/matplotlib/mpl-data/fonts/ttf/ and ran the test plot, all
> the characters are gibberish.  Actually, they are glyphs, but, the
> wrong ones.  The same thing happens if I copy Thyromanes .ttf files
> into that directory, or if I put those files in the $TTFPATH
> directory.  In fact, it also happens if I copy andalemo.ttf, and that
> font doesn't include extra unicode characters.
>
> So, I'll paste the entire debug-annoying output that occurred when I
> was getting the gibberish text on the plot at the end of this email.
> As you can see, I set the font to a nonsense string to illustrate that
> the problem occurs even if the extra font in the directory isn't being
> requested.  Also, I made sure that the extra font wasn't duplicated
> anywhere else in the search path.

The problem is in this line:

   /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf

That's Computer Modern "Extra Symbols" which is mainly comprised of 
characters for composing math equations -- there's no "letters" in there 
at all.  When matplotlib doesn't find an exact match for a font, it's 
supposed to default to Vera Sans.  In all your experimentation, did you 
perhaps delete the Vera Sans that comes with matplotlib?  (It doesn't 
look like it was in the search path.)  Restoring that file should at 
least remove the "gibberish" problem, but you still won't get the fonts 
you want.  You'll (unfortunately) have to do like you did with Arial 
Unicode and set all the parameters correctly.

(You may need to delete your font cache in ~/.matplotlib/ttffont.cache 
as well.)

Cheers,
Mike

> loaded rc file /home/hobbes/.matplotlib/matplotlibrc
> matplotlib version 0.90.1
> verbose.level debug-annoying
> interactive is False
> units is False
> platform is linux2
> loaded modules: ['_bisect', 'distutils', 'pylab', 'datetime',
> 'matplotlib.tempfile', 'distutils.sysconfig', 'pytz.datetime',
> 'pytz.cStringIO', 'struct', 'tempfile', 'imp', 'pytz.os', 'zipimport',
> 'string', 'encodings.utf_8', 'matplotlib.__future__', 'pytz.tzinfo',
> 'distutils.re', 'bisect', 'signal', 'random', 'token',
> 'matplotlib.pytz', 'dis', 'pytz.tzfile', 'cStringIO', 'locale',
> 'encodings', 'dateutil', 'matplotlib.warnings', 'pytz.pytz',
> 'matplotlib.sys', 're', 'math', 'fcntl', 'UserDict', 'inspect',
> 'distutils.os', 'matplotlib', 'codecs', 'md5', '_locale',
> 'matplotlib.os', 'thread', 'sre', 'itertools', 'opcode',
> 'distutils.sys', 'os', '__future__', '_sre', '__builtin__',
> 'matplotlib.re', 'distutils.string', 'matplotlib.datetime',
> 'posixpath', 'errno', 'binascii', 'sre_constants', 'matplotlib.md5',
> 'types', 'pytz.sys', 'tokenize', '_codecs', 'pytz', 'copy',
> 'matplotlib.dateutil', 'posix', 'encodings.aliases', 'exceptions',
> 'sre_parse', 'pytz.bisect', 'copy_reg', 'sre_compile', '_random',
> 'pytz.struct', 'site', '__main__', 'shutil', 'strop',
> 'encodings.codecs', 'gettext', 'encodings.exceptions', 'pytz.sets',
> 'stat', 'warnings', 'encodings.types', 'sys', 'os.path',
> 'pytz.gettext', 'matplotlib.distutils', 'distutils.errors',
> 'linecache', 'matplotlib.shutil', 'sets']
> numerix numpy 1.0.3
> font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf',
> '/usr/share/matplotlib/mpl-data/fonts/afm']
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmr10.ttf
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf
> trying fontname /usr/share/matplotlib/mpl-data/fonts/ttf/ARIALUNI.TTF
> trying fontname /usr/share/fonts/truetype/ttf-sil-padauk/Padauk-Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanai.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSerif.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevG.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightRegular.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Bold.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSerifBold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevE.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiab.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSansOblique.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevC.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiItalic.ttf
> trying fontname
> /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Italic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-BoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/andalemo.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/arialbi.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevB.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansOblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Oblique.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/cour.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryrg__.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldItalic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/courbd.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS.ttf
> trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thrybi__.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Italic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/comicbd.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightItalic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/courbi.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/times.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/georgia.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/trebuc.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSansBold.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeMonoBold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-ExtraLight.ttf
> trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Regular.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanaz.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiai.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Georgia_Italic.ttf
> trying fontname /usr/share/fonts/truetype/kochi/kochi-mincho.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/couri.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-BoldItalic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/ariblk.ttf
> trying fontname /usr/share/fonts/truetype/openoffice/opens___.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevD.ttf
> trying fontname
> /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed-Italic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Black.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Webdings.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterOblique.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-padauk/Padauk.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf
> trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-Italic.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSans.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/ariali.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucbi.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/timesi.ttf
> trying fontname
> /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiBold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/georgiaz.ttf
> trying fontname
> /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryb___.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/timesbd.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/verdana.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/arial.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/comic.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/webdings.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucit.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/timesbi.ttf
> trying fontname /usr/share/fonts/truetype/ttf-thryomanes/thryi___.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerifCondensed.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/impact.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/verdanab.ttf
> trying fontname
> /usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold_Italic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiOblique.ttf
> trying fontname /usr/share/fonts/truetype/kochi/kochi-mincho-subst.ttf
> trying fontname /usr/share/fonts/truetype/ttf-junicode/Junicode-BoldItalic.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeMono.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/trebucbd.ttf
> trying fontname /usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterRegular.ttf
> trying fontname /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiBold.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevA.ttf
> trying fontname /usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevF.ttf
> trying fontname /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
> $HOME=/home/hobbes
> CONFIGDIR=/home/hobbes/.matplotlib
> loaded ttfcache file /home/hobbes/.matplotlib/ttffont.cache
> matplotlib data path /usr/share/matplotlib/mpl-data
> Could not load matplotlib icon: Couldn't recognize the image file
> format for file '/usr/share/matplotlib/mpl-data/images/matplotlib.svg'
> backend GTKAgg version 2.10.6
> FigureCanvasAgg.draw
> RendererAgg.__init__
> RendererAgg.__init__ width=640.0,                         height=480.0
> RendererAgg.__init__ _RendererAgg done
> RendererAgg.__init__ done
> RendererAgg._get_agg_font
> 	findfont failed FOOFOOFOO
> Could not match FOOFOOFOO, normal, normal.  Returning
> /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg.points_to_pixels
> RendererAgg.points_to_pixels
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> RendererAgg._get_agg_font
> 	findfont failed FOOFOOFOO, normal, normal 400, normal, 14.0
> Could not match FOOFOOFOO, normal, normal.  Returning
> /usr/share/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
> RendererAgg._get_agg_font
> RendererAgg.draw_text
> RendererAgg._get_agg_font
> FigureCanvasAgg.buffer_rgba
> RendererAgg.buffer_rgba

--

-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Tom Johnson | 1 Oct 19:25
Picon
Gravatar

Re: edgecolor with usetex=True, usedistiller='pdf'

On 9/27/07, Tom Johnson <tjhnson@...> wrote:
> On 9/27/07, Darren Dale <dd55@...> wrote:
> > On Thursday 27 September 2007 01:28:46 am Tom Johnson wrote:
[snip]
> > > Actually, the problem exists as early as the dvi file.
> > >
> > The dvi looks fine here, and so does my pdf.
[snip]
> Hmm...I have:
>
> ESP Ghostscript 8.15.04 (2007-03-14)
> pdftops version 3.01    (coming from libpoppler1 version 0.5.4-0ubuntu8)
> pdfeTeX 3.141592-1.21a-2.2 (tetex-3.0.dfsg.3-4)
>

After doing some upgrades, I think I have more information about this
issue.  In summary, the problem is fixed, but I think there are still
some questions as to the cause of the earlier problem.  Currently, I
have:

GPL Ghostscript 8.61
pdftops version 3.02
pdfTeX 3.141592-1.40.3-2.2

If I use the scripts in the original email, then there is no problem.
That is, with facecolor='white', the resulting eps, dvi, ps, and pdf
all have a figure with a white facecolor.

Strangely, if I use an EPS from before my upgrades, the problem still
exists.  This has the fortunate effect that I do not need to
regenerate all my images.  In this situation, as described previously,
the eps file looks fine using gv (has a white facecolor).  However,
the resulting dvi, ps, and pdf all have a figure with no
facecolor---and this behavior not consistent with edgecolor.

I am using the same version of matplotlib (before and after the
upgrade)... SVN Revision 3709...and python 2.5 as well.  Since the
problem still occurs with particular EPS files....the problem
definitely must be with the EPS.

I don't know how the EPS file is constructed in matplotlib...does it
make use of external programs like gs (and thus, points the reason
back at EPS Ghostscript)?  In case someone is interested in searching
for the source of the problem, I have attached:

1)  good.eps  (which has a white facecolor when included in a document)
2)  bad eps (which has no facecolor when included in a document)
3) test.pdf (a demonstration of both images in one document)
4) test.tex (the source for test.pdf)

Thanks!
Attachment (bad.eps): application/postscript, 32 KiB
Attachment (good.eps): application/postscript, 21 KiB
Attachment (test.pdf): application/pdf, 9 KiB
Attachment (test.tex): application/x-tex, 253 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jeff Whitaker | 1 Oct 21:16
Favicon

Re: multiple figures interactively

Lee, Young-Jin wrote:
> Folks, I need your help. I'll explain a little further what happens.
> Following is a test program,'test.py', and screen shot of the error
> message. Here, 'test.py' is simple chart of sinusoidal function in
> http://matplotlib.sourceforge.net/screenshots.html (simple_plot.py), but
> have two of them in series. I tried Wolfgang's suggestion but it doesn't
> help. Any idea?
>
> Test.py:
>
> from pylab import *
>
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> plot(t, s, linewidth=1.0)
>
> xlabel('time (s)')
> ylabel('voltage (mV)')
> title('About as simple as it gets, folks')
> grid(True)
> show()
>
> clf()
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> plot(t, s, linewidth=1.0)
>
> xlabel('time (s)')
> ylabel('voltage (mV)')
> title('About as simple as it gets, folks')
> grid(True)
> show()
>   

Young-Jin: 

You can't have two "show()"s in one script.  Comment out the first one, 
and replace the "clf()" with "figure()" and all is well.

Or, use "draw()".

See http://matplotlib.sourceforge.net/faq.html#SHOW for details.

-Jeff

>
> Execution of test.py:
>
> c:\Python24>python test.py
> c:\Python24\lib\site-packages\matplotlib\numerix\__init__.py:53:
> DeprecationWarn
> ing: numarray use as a numerix backed for matplotlib is deprecated
>   DeprecationWarning, stacklevel=1)
> Fatal Python error: PyEval_RestoreThread: NULL tstate
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>
> c:\Python24>
>
> -----Original Message-----
> From: Wolfgang Kerzendorf [mailto:wkerzendorf@...] 
> Sent: Wednesday, September 26, 2007 9:03 PM
> To: Lee, Young-Jin
> Cc: matplotlib-users@...
> Subject: Re: [Matplotlib-users] multiple figures interactively
>
> This might help you it destroys the whole window:
> pylab.get_current_fig_manager().destroy()
> and then you open it again with show
> Lee, Young-Jin wrote:
>   
>> Hi,
>>
>> I 'm writing a python program that draws figures one by one 
>> interactively with the user's input in dos mode. Basically, I give the
>>     
>
>   
>> program a decision after each figure and then it draws the next one. 
>> After the first figure, it got very much slowed down for the second 
>> one and crashed for the third one. I feel like it has some memory 
>> issues as I keep using 'show' after I close each. I used 'clf()' 
>> before I draw a new one, but it doesn't seem to help. Any idea?
>>     
> Thanks.
>   
>> Young Jin
>>
>>
>>     

--

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@...
325 Broadway                Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Darren Dale | 1 Oct 22:23
Picon
Favicon

Re: edgecolor with usetex=True, usedistiller='pdf'

On Monday 01 October 2007 01:25:11 pm Tom Johnson wrote:
> On 9/27/07, Tom Johnson <tjhnson@...> wrote:
> > On 9/27/07, Darren Dale <dd55@...> wrote:
> > > On Thursday 27 September 2007 01:28:46 am Tom Johnson wrote:
>
> [snip]
>
> > > > Actually, the problem exists as early as the dvi file.
> > >
> > > The dvi looks fine here, and so does my pdf.
>
> [snip]
>
> > Hmm...I have:
> >
> > ESP Ghostscript 8.15.04 (2007-03-14)
> > pdftops version 3.01    (coming from libpoppler1 version 0.5.4-0ubuntu8)
> > pdfeTeX 3.141592-1.21a-2.2 (tetex-3.0.dfsg.3-4)
>
> After doing some upgrades, I think I have more information about this
> issue.  In summary, the problem is fixed, but I think there are still
> some questions as to the cause of the earlier problem.  Currently, I
> have:
>
> GPL Ghostscript 8.61
> pdftops version 3.02
> pdfTeX 3.141592-1.40.3-2.2
>
> If I use the scripts in the original email, then there is no problem.
> That is, with facecolor='white', the resulting eps, dvi, ps, and pdf
> all have a figure with a white facecolor.
>
> Strangely, if I use an EPS from before my upgrades, the problem still
> exists.  This has the fortunate effect that I do not need to
> regenerate all my images.  In this situation, as described previously,
> the eps file looks fine using gv (has a white facecolor).  However,
> the resulting dvi, ps, and pdf all have a figure with no
> facecolor---and this behavior not consistent with edgecolor.
>
> I am using the same version of matplotlib (before and after the
> upgrade)... SVN Revision 3709...and python 2.5 as well.  Since the
> problem still occurs with particular EPS files....the problem
> definitely must be with the EPS.
>
> I don't know how the EPS file is constructed in matplotlib...does it
> make use of external programs like gs (and thus, points the reason
> back at EPS Ghostscript)?  In case someone is interested in searching
> for the source of the problem, I have attached:

It was a problem introduced by one of the external dependencies during the 
distillation process, that's why your old eps files still look the way they 
do. It was not a problem with the viewer. It looks like the problem was fixed 
in a recent ghostscript release, and I don't think the matplotlib mailing 
lists are an appropriate forum for discussing problems with ghostscript.

Darren

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane