Pim Schellart | 1 Sep 08:44
Picon

Compiling matplotlib (freetype issues)

Hi Everyone,

after I encountered some problems embedding matplotlib in a Tkinter
application I decided to update my matplotlib installation.
I downloaded and installed Python 2.6.2 and the latest svn checkouts
of numpy and scipy.
Then I tried to install (the latest svn checkout of) matplotlib using
python setup.py install.
I get the following errors related to freetype2.
I first tried reinstalling freetype2 (latest version from source which
is now installed in /usr/local) but this did not solve the problem.
Does anyone know what might be wrong here?

gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3
-DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API
-I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
-I. -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/freetype2
-I./freetype2 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
-c src/ft2font.cpp -o build/temp.macosx-10.3-fat-2.6/src/ft2font.o
In file included from src/ft2font.cpp:1In file included from src/ft2font.cpp:1:
src/ft2font.h:13:22: error: ft2build.h: No such file or directory
src/ft2font.h:14:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:15:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:16:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:17:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:18:10: error: #include expects "FILENAME" or <FILENAME>
:
src/ft2font.h:13:22: error: ft2build.h: No such file or directory
src/ft2font.h:14:10: error: #include expects "FILENAME" or <FILENAME>
(Continue reading)

Eric Firing | 1 Sep 08:53
Favicon
Gravatar

Re: Compiling matplotlib (freetype issues)

Pim Schellart wrote:
> Hi Everyone,
> 
> after I encountered some problems embedding matplotlib in a Tkinter
> application I decided to update my matplotlib installation.
> I downloaded and installed Python 2.6.2 and the latest svn checkouts
> of numpy and scipy.
> Then I tried to install (the latest svn checkout of) matplotlib using
> python setup.py install.
> I get the following errors related to freetype2.
> I first tried reinstalling freetype2 (latest version from source which
> is now installed in /usr/local) but this did not solve the problem.
> Does anyone know what might be wrong here?
> 
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3
> -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API
> -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
> -I. -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/freetype2
> -I./freetype2 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> -c src/ft2font.cpp -o build/temp.macosx-10.3-fat-2.6/src/ft2font.o
> In file included from src/ft2font.cpp:1In file included from src/ft2font.cpp:1:
> src/ft2font.h:13:22: error: ft2build.h: No such file or directory

Evidently it is not finding the header file(s) for freetype--it must not 
be in any of the -I paths above.

Eric

------------------------------------------------------------------------------
(Continue reading)

Johann Rohwer | 1 Sep 09:03
Picon
Picon
Favicon

Re: Compiling matplotlib (freetype issues)

On Tuesday 01 September 2009, Pim Schellart wrote:
> after I encountered some problems embedding matplotlib in a Tkinter
> application I decided to update my matplotlib installation.
> I downloaded and installed Python 2.6.2 and the latest svn
> checkouts of numpy and scipy.
> Then I tried to install (the latest svn checkout of) matplotlib
> using python setup.py install.
> I get the following errors related to freetype2.
> I first tried reinstalling freetype2 (latest version from source
> which is now installed in /usr/local) but this did not solve the
> problem. Does anyone know what might be wrong here?
>
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3
> -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API
> -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/s
>ite-packages/numpy/core/include -I.
> -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/s
>ite-packages/numpy/core/include/freetype2 -I./freetype2
> -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2
>.6 -c src/ft2font.cpp -o
> build/temp.macosx-10.3-fat-2.6/src/ft2font.o In file included from
> src/ft2font.cpp:1In file included from src/ft2font.cpp:1:
> src/ft2font.h:13:22: error: ft2build.h: No such file or directory

Have you installed the development headers (i.e. libfreetype2-devel)?
Johann

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
(Continue reading)

Pim Schellart | 1 Sep 12:20
Picon

Re: Compiling matplotlib (freetype issues)

Hi Everyone,

I managed to install matplotlib (python 2.6.2 on OSX Leopard 10.5) by
making the following adjustments to the installation.

1. In setupext.py changing the line with

'darwin' : [],

to

'darwin' : ['/usr/local', '/usr'],

2. In /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile
removing all occurences of -arch ppc.

Both of these fixes should not be nesesary so either there are some
problems with the installer or with my OSX setup.
Can someone tell me which of the two it is?

Kind regards,

Pim Schellart

2009/9/1 Pim Schellart <P.Schellart-oe7qfRrRQfcVP2d+270tTEYqX0Djs4uF <at> public.gmane.org>:
> Hi Everyone,
>
> after I encountered some problems embedding matplotlib in a Tkinter
> application I decided to update my matplotlib installation.
> I downloaded and installed Python 2.6.2 and the latest svn checkouts
(Continue reading)

Pim Schellart | 1 Sep 12:23
Picon

Drawing on a Tkinter canvas (malloc errors in example)

Hi Everyone,

I recently (re)installed the latest svn checkout of matplotlib on a
fresh install of python 2.6.2 (running on OSX Leopard 10.5).
When I run the embedding example at
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html
or http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk2.html
I get the following malloc errors:

Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Python(17023,0xa0427720) malloc: *** error for object 0xa00726d8:
Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
(Continue reading)

Michael Droettboom | 1 Sep 16:40

Re: Unknown Path Error

Without a some example code to reproduce the bug, it's going to be very 
difficult to track this down.  The "pick_event_demo.py" is working for 
me, and it flows through the offending method without problems.  It's 
possible that your code sets things up in a way we didn't anticipate and 
it worked "by accident" in earlier versions, and a change has broken it 
now.  We'd like to not have these breakages, but without seeing what 
you're doing, it's impossible to avoid that.

If you can't provide a standalone example, can you at least provide the 
complete traceback (not just the inner most frame)?

Mike

Andrew Kelly wrote:
> I spent some time trying to cobble one together but it was taking too 
> much time so I tried the following and it seems to work now:
>
> Instead of using a thick line2D and adding it to the drawing, I added 
> a patches.Rectangle instead.  The line2D works in 0.88.5 but not in 
> 0.99.  The newer version was tripping over the Artist.contains() 
> function call when used with line2D.
>
> On Mon, Aug 31, 2009 at 1:28 PM, Michael Droettboom <mdroe@... 
> <mailto:mdroe@...>> wrote:
>
>     Can you provide a standalone example that reproduces this error?
>
>     Cheers,
>     Mike
>
(Continue reading)

Michael Droettboom | 1 Sep 16:51

Re: setting axis label offset from end of spine

Ah.  I wasn't quite clear on what you were trying to do before.

There's actually a bit of "magic" in there that automatically adjusts 
the xlabel so it is lower than the xtick values.  (If you rotate the 
xtick values, you can see this in action).  So it actually does position 
things how you want, but then when it goes to draw it is automatically 
lowering the text a little to make room.

Since I don't see an easy way around this magic, you could not use 
xlabel at all and just add some Axes text:

    from matplotlib import text
    text = text.Text(1, 0, "Foo")
    text.set_transform(offset_copy(axes.transAxes, axes.figure, x=5, 
y=0, units='points'))
    text.set_clip_on(False)
    axes.add_artist(text)

Completely non-obvious of course :)  If there's enough need for the kind 
of xlabels you're making, we should probably provide a way to do this 
directly, but it would have to be well-tested to ensure it didn't break 
existing functionality.

Mike

jason-sage@... wrote:
> Michael Droettboom wrote:
>> The xlabel doesn't use the data transform, it uses the axes 
>> transform, where the edges of the axes always go from 0.0 to 1.0, 
>> regardless of the data extents.  Therefore, tou can start with the 
(Continue reading)

jason | 1 Sep 17:09

Re: setting axis label offset from end of spine

Michael Droettboom wrote:
> Ah.  I wasn't quite clear on what you were trying to do before.
>
> There's actually a bit of "magic" in there that automatically adjusts 
> the xlabel so it is lower than the xtick values.  (If you rotate the 
> xtick values, you can see this in action).  So it actually does 
> position things how you want, but then when it goes to draw it is 
> automatically lowering the text a little to make room.
>
> Since I don't see an easy way around this magic, you could not use 
> xlabel at all and just add some Axes text:
>
>    from matplotlib import text
>    text = text.Text(1, 0, "Foo")
>    text.set_transform(offset_copy(axes.transAxes, axes.figure, x=5, 
> y=0, units='points'))
>    text.set_clip_on(False)
>    axes.add_artist(text)
>
> Completely non-obvious of course :)  If there's enough need for the 
> kind of xlabels you're making, we should probably provide a way to do 
> this directly, but it would have to be well-tested to ensure it didn't 
> break existing functionality.
>
Ah---I realized that there was some automagic positioning going on if I 
didn't use subplot.xaxis.set_label_coords (thank goodness that I can 
read the source!).  So now I have something that *almost* works 
perfectly.  Here is a complete example:

import matplotlib.pyplot as plt
(Continue reading)

jakobg | 1 Sep 17:09
Picon

Placing vector eps graphics


Hi there,

I want to place an eps graphic I created in Inkscape in a plot. The final
image is supposed to be a vector eps as well. I looked up the forum but just
found the option with the Image (PIL) library which obviously rasterizes my
vector image. And I use the Tex option so I cannot just save as SVG and do
the compositing stuff in Inkscape.

The placing of the image is straight forward and fine documented (with
additional axes and imshow), so it is just a problem of importing a eps
vector image.

I would be very grateful if someone could help me with this issue.

Thanks!
Jakob

--

-- 
View this message in context: http://www.nabble.com/Placing-vector-eps-graphics-tp25242043p25242043.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Michael Droettboom | 1 Sep 17:28

Re: Placing vector eps graphics

Unfortunately, matplotlib doesn't support importing vector images of any 
sort.

Your best bet is to, as you suggest, do the compositing in an external 
tool, such as Inkscape.  Version 0.46 and later claim to support PDF 
import, you could try that.  (Though I haven't tried it with a 
matplotlib plot personally, so no promises...)

Cheers,
Mike

jakobg wrote:
> Hi there,
>
> I want to place an eps graphic I created in Inkscape in a plot. The final
> image is supposed to be a vector eps as well. I looked up the forum but just
> found the option with the Image (PIL) library which obviously rasterizes my
> vector image. And I use the Tex option so I cannot just save as SVG and do
> the compositing stuff in Inkscape.
>
> The placing of the image is straight forward and fine documented (with
> additional axes and imshow), so it is just a problem of importing a eps
> vector image.
>
> I would be very grateful if someone could help me with this issue.
>
> Thanks!
> Jakob
>
>
(Continue reading)


Gmane