[Matplotlib-users] logarithmic spectrogram
Hallo! (Sorry if this is maybe a basic question, but I did not find something in the archives or in the net) I am trying to make a spectrogram of audio data with the function specgram, where the frequency axis is logarithmic (as it is used usually in audio/speech processing). However, specgram uses a linear frequency axis by default and I was not able to change this behaviour ... So my question: is it possible to get a logarithmic frequency axis with specgram or any other function ? Many thanks for any hints, LG Georg - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Static linking problem on matplotlib eggs
I'm trying to build some matplotlib eggs to bundle and distribute with some other python packages. So, I am doing my best to statically link to libraries like libpng, libfreetype, etc. that users may not have installed. I am building using the following: python setupegg.py config -L../staticlibs build bdist_egg where ../staticlibs contains the libraries that I am statically linking. Unfortunately, users are still getting errors such as the following: ImportError: dlopen(/Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2): Library not loaded: /usr/local/lib/libpng12.0.dylib Referenced from: /Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so Reason: image not found Anyone have a clue what I am not doing properly? Thanks, Chris - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] logarithmic spectrogram
Georg Holzmann wrote: Hallo! (Sorry if this is maybe a basic question, but I did not find something in the archives or in the net) I am trying to make a spectrogram of audio data with the function specgram, where the frequency axis is logarithmic (as it is used usually in audio/speech processing). However, specgram uses a linear frequency axis by default and I was not able to change this behaviour ... So my question: is it possible to get a logarithmic frequency axis with specgram or any other function ? One way would be to use the NonUniformImage class in image.py instead of the Image class that is being used by the imshow() call in Axes.specgram. See examples/pcolor_nonuniform.py for an example of how to use the NonUniformImage class. Eric Many thanks for any hints, LG Georg - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Static linking problem on matplotlib eggs
I just had to rebuild the OSX binary because a similar reason. I forgot to change the basedir['darwin'] entry in setupext.py. Around line 50. Change: 'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local', '/usr', '/sw', '/usr/X11R6'], To: 'darwin' : [], This will ensure you don't pick up shared libraries over the static ones since they are preferred by gcc. - Charlie On Jan 12, 2008 12:04 PM, Chris [EMAIL PROTECTED] wrote: I'm trying to build some matplotlib eggs to bundle and distribute with some other python packages. So, I am doing my best to statically link to libraries like libpng, libfreetype, etc. that users may not have installed. I am building using the following: python setupegg.py config -L../staticlibs build bdist_egg where ../staticlibs contains the libraries that I am statically linking. Unfortunately, users are still getting errors such as the following: ImportError: dlopen(/Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2): Library not loaded: /usr/local/lib/libpng12.0.dylib Referenced from: /Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so Reason: image not found Anyone have a clue what I am not doing properly? Thanks, Chris - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Static linking problem on matplotlib eggs
Thanks Charlie, I've done this, but for some reason, its still looking for things in / usr/local: In file included from src/ft2font.h:11, from src/ft2font.cpp:2: /usr/local/include/ft2build.h:56:38: error: freetype/config/ ftheader.h: No such file or directory cf On 12/01/2008, at 12:42 PM, Charlie Moad wrote: I just had to rebuild the OSX binary because a similar reason. I forgot to change the basedir['darwin'] entry in setupext.py. Around line 50. Change: 'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/ local', '/usr', '/sw', '/usr/X11R6'], To: 'darwin' : [], This will ensure you don't pick up shared libraries over the static ones since they are preferred by gcc. - Charlie On Jan 12, 2008 12:04 PM, Chris [EMAIL PROTECTED] wrote: I'm trying to build some matplotlib eggs to bundle and distribute with some other python packages. So, I am doing my best to statically link to libraries like libpng, libfreetype, etc. that users may not have installed. I am building using the following: python setupegg.py config -L../staticlibs build bdist_egg where ../staticlibs contains the libraries that I am statically linking. Unfortunately, users are still getting errors such as the following: ImportError: dlopen(/Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so, 2): Library not loaded: /usr/local/lib/libpng12.0.dylib Referenced from: /Library/Python/2.5/site-packages/ matplotlib-0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/_path.so Reason: image not found Anyone have a clue what I am not doing properly? Thanks, Chris - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Hi Michael, Sorry for getting back to you only now, and thanks for the help. If you have Qt installed there should be an sample Svg viewer app in the examples somewhere. If you'd like I can send it to you somehow, just let me know. I tested the new .svg you sent me it's rendering the same in Firefox and Qt. So it works. Once again thanks for your help and let me know if I can send you something to help with testing in Qt. Personally I think Qt's support for svg is still a bit iffy. Have a nice, Christiaan On 04/01/2008, Michael Droettboom [EMAIL PROTECTED] wrote: Can you please test the attached SVG file? Cheers, Mike Michael Droettboom wrote: Between 0.90 and 0.91, the SVG backend was changed to store the glyph outlines of the characters in the SVG file itself. (This is on by default, but can be turned off with the rc parameter svg.embed_char_paths). This helps make the SVG files much more portable, as the need to install the math fonts has long been a FAQ on this list. I've been doing all my testing with Firefox and Inkscape. Is there a simple Qt-based SVG viewer I could add to my testing regimen? I won't pretend to be an expert on the SVG spec, but it does say this: http://www.w3.org/TR/SVG/struct.html#Head To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local URI references within a 'defs' element which is a direct child of one of the ancestors of the referencing element. For example: ?xml version=1.0 standalone=no? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; svg width=8cm height=3cm xmlns=http://www.w3.org/2000/svg; descLocal URI references within ancestor's 'defs' element./desc defs linearGradient id=Gradient01 stop offset=20% stop-color=#39F / stop offset=90% stop-color=#F3F / /linearGradient /defs rect x=1cm y=1cm width=6cm height=1cm fill=url(#Gradient01) / !-- Show outline of canvas using 'rect' element -- rect x=.01cm y=.01cm width=7.98cm height=2.98cm fill=none stroke=blue stroke-width=.02cm / /svg View this example as SVG (SVG-enabled browsers only) In the document above, the linear gradient is defined within a 'defs' element which is the direct child of the 'svg' element, which in turn is an ancestor of the 'rect' element which references the linear gradient. Thus, the above document conforms to the guideline. So we are complying to that part of the spec. The spec doesn't seem to say anything about whether the defs must appear before or after their use -- but maybe I just can't find the relevant paragraph. In any case, this should be easy enough to fix on matplotlib's end, and certainly won't break compliance with the spec. I'll have a look, and may come back to you for help with testing with Qt if you don't mind. Cheers, Mike Christiaan Putter wrote: Hi there, Just an update regarding the svg problem I was having: I simply went back to 0.90 and that's working now. Would still be nice to know if the svg output from matplotlib complies with the standard or whether it's Qt that's messing things up. Merry x-mass! cputter On 21/12/2007, *Christiaan Putter* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi guys and girls, Quick question regarding matplotlib's svg backend... I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having some problems with .svg files created by matplotlib. Text isn't showing up. Firefox displays the same .svg file correctly though... The problem: It seems some text stuff is stored in a section called defs at the end of the file with stuff linking to this earlier in the file. Qt doesn't like that and only displays the normal plot stuff (lines, etc.) but not the labels and other text. More exact: use xlink:href=#c_7 . references path id=c_7 d=M10.6875 . at the end of the file. When I simply cut and paste the defs section to the beginning of the file it solves the problem. What does the svg standard say about this? I assume Qt's implementation is defect... Has anybody else encountered this problem? I'll send an e-mail to Qt too and ask them about it. Hope you're all having a nice day. Regards, cputter - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___
Re: [Matplotlib-users] logarithmic spectrogram
Hallo! Thanks for your answer ! One way would be to use the NonUniformImage class in image.py instead of the Image class that is being used by the imshow() call in Axes.specgram. Hm ... I looked into image.py but I don't know how this is used by specgram (sorry, I am a newbie - and did not find more about specgram in the matplotlib source (where is the specgram source?)). Could you maybe give some more hints how I would have to do this ? (or are there maybe examples in which I can look?) Or did nobody else use a logarithmic spectrogram before ? Thanks, LG Georg - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users