Re: [Matplotlib-users] Type 1 font in figures needed
Thanks I guess that did the trick! On Tue, May 25, 2010 at 9:37 PM, Eric Firing efir...@hawaii.edu wrote: On 05/25/2010 10:21 AM, Michael Droettboom wrote: There isn't a way to embed Type 1 fonts, but you can force matplotlib to use the core 14 Postscript fonts only by setting the rcParam ps.useafm to True. Or for the pdf backend, rcParams['pdf.use14corefonts'] = True and refrain from using any mathtext formatting.ankls Eric Mike On 05/25/2010 04:10 PM, David Reichert wrote: Hi, I'm writing a conference paper and I must use only type 1 fonts. It seems like matplotlib is using type 3. How can I use type 1 instead? Thanks, David The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Clearing A Figure (I Know That This Has Been Posted Before But I Does Not Work For Me)
w/o seeing the entire code it is difficult to diagnose. Nothing looks wrong with your code. However, for full control I suggest you use the API; see examples at http://matplotlib.sourceforge.net/examples/api/index.html and take a look at the artist tutorial at http://matplotlib.sourceforge.net/users/artists.html. Thank you. The tutorial was very helpful. For a moment I thought I might have found the answer with the lines.remove() function but alas, it did not make a difference yet again. :( I am starting to feel that this is a problem with my setup rather than my code. I may have to try this on someone else's computer. In a nutshell fig = plt.figure() ax = fig.add_subplot(111) for param in myparams: fig.clf() ax.plot(something_with(param)) ax.set_ylabel('Sum Squared Error') ax.set_title('Plot of Iris Training Errors') ax.set_ylim(ymin=0) outfilename = '%d.png'%param fig.savefig(outfilename) This is almost exactly the same as something else I have tried but this is all to no avail. I have posted all of my code at http://code-bin.homedns.org/653 if anyone has time to look at it. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://old.nabble.com/Clearing-A-Figure-%28I-Know-That-This-Has-Been-Posted-Before-But-I-Does-Not-Work-For-Me%29-tp28665976p28678426.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Compiling matplotlib against 64 bit python 2.6 on OSX Snow Leopard
Hi John and George, I did of course rtfm :) However when I do this for the latest svn checkout I get: matplotlib $ PREFIX=/usr/local sudo make -f make.osx fetch deps mpl_install Password: python2.6 -c 'import urllib; urllib.urlretrieve(http://www.zlib.net/zlib-1.2.3.tar.gz;, zlib-1.2.3.tar.gz)' \ python2.6 -c 'import urllib; urllib.urlretrieve(http://downloads.sourceforge.net/project/libpng/libpng-stable/1.2.39/libpng-1.2.39.tar.gz;, libpng-1.2.39.tar.gz)' \ python2.6 -c 'import urllib; urllib.urlretrieve(http://download.savannah.gnu.org/releases/freetype/freetype-2.3.11.tar.bz2;, freetype-2.3.11.tar.bz2)' export PKG_CONFIG_PATH=/lib/pkgconfig \ rm -rf zlib-1.2.3 \ tar xvfj zlib-1.2.3.tar.gz \ cd zlib-1.2.3 \ export MACOSX_DEPLOYMENT_TARGET=10.6 \ export CFLAGS=-arch i386 -arch x86_64 -I/include -I/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk \ export LDFLAGS=-arch i386 -arch x86_64 -L/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk \ ./configure --prefix=\ MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=-arch i386 -arch x86_64 -I/include -I/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk LDFLAGS=-arch i386 -arch x86_64 -L/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk make -j3 install \ unset MACOSX_DEPLOYMENT_TARGET tar: Unrecognized archive format: Inappropriate file type or format tar: Error exit delayed from previous errors. make: *** [zlib] Error 1 However I would prefer to use my independently installed freetype2 and libpng libraries, rather than installing them again. Does anyone have an idea where the architecture error comes from, or how to check this? Also, why is a separate make.osx file needed? Could the same functionality not have been integrated into the setup.py script? This is not a rant, just a question :) Kind regards, Pim Schellart 2010/5/25 George Nurser gnur...@gmail.com: If what John suggests doesn't work, and you really only need 64 bit, then the nuclear option is to remove all occurrences of -arch i386 from the makefile (assuming you have a framework build) at /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/config/Makefile This should only generate x86_64. Obviously, save the current one, so you can go back to it. HTH, George. On 25 May 2010 16:58, John Hunter jdh2...@gmail.com wrote: On Tue, May 25, 2010 at 10:45 AM, Pim Schellart p.schell...@gmail.com wrote: Hi John and George, I tried both and although it now seems to find the libraries it still fails to link something. matplotlib-0.99.1.1 $ sudo python setup.py install According to the README I pointed you too, this isn't the command you should be running. Rather, Example usage:: PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install But I advise you work from the svn trunk if you want to go this route, as I have made some updates for 64bit/python2.6 OSX there svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib JDH -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] interpolate inside a circle
Le mardi 25 mai 2010 à 21:47 -0300, Carlos Grohmann a écrit : Dears, I want to interpolate some irregular data using radial basis. Can I interpolate only the data that falls inside a circle (or a polygon)? May these pages help you? http://www.scipy.org/Cookbook/RadialBasisFunctions http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Compiling matplotlib against 64 bit python 2.6 on OSX Snow Leopard
On Wed, May 26, 2010 at 5:18 AM, Pim Schellart p.schell...@gmail.com wrote: Hi John and George, I did of course rtfm :) However when I do this for the latest svn checkout I get: matplotlib $ PREFIX=/usr/local sudo make -f make.osx fetch deps mpl_install Password: python2.6 -c 'import urllib; urllib.urlretrieve(http://www.zlib.net/zlib-1.2.3.tar.gz;, zlib-1.2.3.tar.gz)' \ python2.6 -c 'import urllib; urllib.urlretrieve(http://downloads.sourceforge.net/project/libpng/libpng-stable/1.2.39/libpng-1.2.39.tar.gz;, libpng-1.2.39.tar.gz)' \ python2.6 -c 'import urllib; urllib.urlretrieve(http://download.savannah.gnu.org/releases/freetype/freetype-2.3.11.tar.bz2;, freetype-2.3.11.tar.bz2)' export PKG_CONFIG_PATH=/lib/pkgconfig \ rm -rf zlib-1.2.3 \ tar xvfj zlib-1.2.3.tar.gz \ cd zlib-1.2.3 \ export MACOSX_DEPLOYMENT_TARGET=10.6 \ export CFLAGS=-arch i386 -arch x86_64 -I/include -I/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk \ export LDFLAGS=-arch i386 -arch x86_64 -L/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk \ ./configure --prefix=\ MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=-arch i386 -arch x86_64 -I/include -I/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk LDFLAGS=-arch i386 -arch x86_64 -L/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk make -j3 install \ Looks like a bug in the makefile -- when un-tarring zlib, it should be 'tar xvfz' not 'tar xvfj'. I was recently tinkering with bz bs gz files and looks like the flags got out of whack. I've patched this in svn so you can 'svn up' and try again. unset MACOSX_DEPLOYMENT_TARGET tar: Unrecognized archive format: Inappropriate file type or format tar: Error exit delayed from previous errors. make: *** [zlib] Error 1 However I would prefer to use my independently installed freetype2 and libpng libraries, rather than installing them again. Does anyone have an idea where the architecture error comes from, or how to check this? Also, why is a separate make.osx file needed? Could the same functionality not have been integrated into the setup.py script? This is not a rant, just a question :) You could hack through make.osx to find your own libs. We do it this way to build distributable binaries where we can't count on targets having the right png/freetype on their os x systems. distutils is limited as a configure system so it is difficult to hack this kind of stuff into setup.py. Not that what we are doing is ideal, but we have been striving for works over perfect. The former is hard enough on OS X. Any improvements you can make to make this more general are of course welcome. JDH -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Dual x-axes with transformation
You need to define your own transform. And the best way is to read through the transforms.py. Here is a modified version of your example that uses a custom transform. However, often you may need to use a custom locator also for this kind of transform. HTH, -JJ from matplotlib.transforms import Transform, BlendedGenericTransform, IdentityTransform c = 3.e2 class Freq2WavelengthTransform(Transform): input_dims = 1 output_dims = 1 is_separable = False has_inverse = True def transform(self, tr): return c/tr def inverted(self): return Wavelength2FreqTransform() class Wavelength2FreqTransform(Freq2WavelengthTransform): def inverted(self): return Freq2WavelengthTransform() import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost aux_trans = BlendedGenericTransform(Freq2WavelengthTransform(), IdentityTransform()) fig = plt.figure(2) ax_GHz = SubplotHost(fig, 1,1,1) fig.add_subplot(ax_GHz) ax_GHz.set_xlabel(Frequency (GHz)) import numpy as np xvals = np.arange(199.9, 999.9, 0.1) #make some test data data = np.sin(0.03*xvals) ax_mm = ax_GHz.twin(aux_trans) ax_mm.set_xlabel('Wavelength (mm)') ax_mm.set_viewlim_mode(transform) ax_mm.axis[right].toggle(ticklabels=False) ax_GHz.plot(xvals, data) ax_GHz.set_xlim(200, 1000) plt.draw() plt.show() On Wed, May 26, 2010 at 7:24 AM, Sarah Graves sf...@cam.ac.uk wrote: Hi, I've made a matplotlib plot with frequency on the x-axis, and I would like to add an additional x-axis at the top that is measured in wavelength , i.e. wavelength = 3e8 / frequency Is there anyway to do this transformation automatically in matplotlib? I tried to give a transformation argument to the ax.twin() axes_grid command, as shown in the axes_grid parasite_simple2.py example, but I've not managed to get this to work with a transformation more complicated than a scaling by a constant factor. I tried looking at the matplotlib.transforms documentation but I couldn't see a way to do this transformation there. I'm not sure I understood it very well though. I can't simply use the twiny( ) command and manually set the limits as the wavelength ticks will not occur at the points corresponding to the correct frequency. At the moment I am using the twin() command, and then I manually choose a sensible set of tickvalues I want in wavelength units, calculate the corresponding frequency values, and then set the tick locations to be the frequency values and the tick labels to be the wavelength values. Thanks, Sarah Example code: import numpy as np import matplotlib from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost import matplotlib.pyplot as plt #create xaxis range of values -- 200 -- 1000 Ghz xvals = np.arange(199.9, 999.9, 0.1) #make some test data data = np.sin(0.03*xvals) #set up the figure fig = plt.figure() ax = SubplotHost(fig, 111) fig.add_subplot(ax) ax2 = ax.twin() #plot data ax.plot(xvals, data) ax.set_xlim(200.0, 1000.0) #set up ax2 with chosen values wavelength_labels = np.array([0.4, 0.6, 0.8,1.0,1.2, 1.4]) #in mm frequency_points = 3e2/wavelength_labels #in GHz ax2.set_xticks(frequency_points) ax2.set_xticklabels(wavelength_labels) ax2.set_xlabel('Wavelength (mm)') ax.set_xlabel('Frequency (GHz)') plt.show() -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Remove ticklines but keep labels
There is no clear api to manage this. Try something like ax = gca() for t in ax.xaxis.get_major_ticks(): t.tick1On = False t.tick2On = False -JJ On Wed, May 26, 2010 at 6:30 AM, John Reid j.r...@mail.cryst.bbk.ac.uk wrote: Hi, This is probably easy to do but I didn't work it out from the documentation so far. How do I remove the tick lines on a plot but keep the labels? Thanks, John. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib-users Digest, Vol 48, Issue 46
Yes I wrote about problem with show() , too is matplotlib seriouse project Sandy Hi, I am a real newbie at matplotlib, so I apologize if this is an obvious question. I am running ipython in emacs and while the first time I use the show() command in the ipython buffer the graph shows up fine, subsequent times that I call the command it, the graph does not show up. I am on ubuntu 10.04 (64) and I built the matplotlib library from source. I am trying to get the graphs to show up the subsequent times as well (sorry for the pun). Thanks for any help. Ted Rosenbaum Graduate Student Department of Economics Yale University From: matplotlib-users-requ...@lists.sourceforge.net Subject: Matplotlib-users Digest, Vol 48, Issue 46 To: matplotlib-users@lists.sourceforge.net Date: Wed, 26 May 2010 04:41:13 + Send Matplotlib-users mailing list submissions to matplotlib-users@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/matplotlib-users or, via email, send a message with subject or body 'help' to matplotlib-users-requ...@lists.sourceforge.net You can reach the person managing the list at matplotlib-users-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than Re: Contents of Matplotlib-users digest... Today's Topics: 1. interpolate inside a circle (Carlos Grohmann) 2. Re: Mac backend problems for nearly all backends. (Jonathan Stickel) 3. Re: Mac backend problems for nearly all backends. (Daniel Welling) 4. Show() in emacs (Ted Rosenbaum) 5. Re: Mac backend problems for nearly all backends. (Michiel de Hoon) -- Message: 1 Date: Tue, 25 May 2010 21:47:14 -0300 From: Carlos Grohmann carlos.grohm...@gmail.com Subject: [Matplotlib-users] interpolate inside a circle To: matplotlib-users matplotlib-users@lists.sourceforge.net Message-ID: aanlktinpc_vk2z_jbrqfvfvalapfxxll88h-rvu2s...@mail.gmail.com Content-Type: text/plain; charset=windows-1252 Dears, I want to interpolate some irregular data using radial basis. Can I interpolate only the data that falls inside a circle (or a polygon)? TIA -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of S?o Paulo, Brazil http://www.igc.usp.br/pessoais/guano Linux User #89721 Can?t stop the signal. -- Message: 2 Date: Tue, 25 May 2010 20:48:27 -0600 From: Jonathan Stickel jjstic...@vcn.com Subject: Re: [Matplotlib-users] Mac backend problems for nearly all backends. To: matplotlib-users@lists.sourceforge.net Message-ID: 4bfc8bfb.9000...@vcn.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 05/25/2010 matplotlib-users-requ...@lists.sourceforge.net wrote: From: Christopher Barker chris.bar...@noaa.gov Subject: Re: [Matplotlib-users] Mac backend problems for nearly all backends. To: matplotlib-users@lists.sourceforge.net Message-ID: 4bfc626c.40...@noaa.gov Content-Type: text/plain; charset=ISO-8859-1; format=flowed Jonathan Stickel wrote: I've experienced many of the same problems on Mac OS X 10.6.3 (Snow Leopard). I have python/scipy/numpy/matplotlib/ipython all installed via Macports. Just to be clear -- this sounds like a MacPorts problem, not necessarily an OS-X problem. I finally have the WXagg backend working, but that required installed WXPython with the gtk/X11 backend. Does MacPorts not allow a native wx? Maybe becasue you're running 64 bit? Right, I am running Snow Leopard and have Python 2.6 installed 64 bit. Apparently, Carbon requires 32 bit and wxWidgets/wxPython does not (yet) support Cocoa. This problem will bite you in one form or another on Mac OS X, regardless of whether you are using Macports or something else. Anyway, I guess that's why I don't use macports for python. See above. In any case, I have been having royal problems with GUI backends and matplotlib. Some background on where I've been having these problems: Machine 1: OSX 10.5.8 G5 PPC That's what I've been running, and I've had no real issues (Haven't tried the OS-X back-end) -- but I'm using the python.org python. Machine 2: OSX 10.5.7 Macbook pro/Intel Code versions: python 2.5.4, Numpy 1.3.0, Scipy 0.7.0 (all obtained through fink.) OK -- then a fink issue, rather than a Macports one -- same idea, though. My impression is that neither fink nor macports do well with Mac GUI stuff -- unless you're talking X11. Not exactly true. Fink and Macports are tools and have their shortcomings, but both can be immensely useful for installing all this stuff. Otherwise, you do it manually, which of course can cause you
[Matplotlib-users] savefig eps error
today i produced an image that failed to save to eps. i can save the file in pdf, but i get the same error if i try to use pdf2ps. png works too, but its not vector. not sure if its important, but the image has 401 lines, with 500 points each. the image is produced from a bunch of data files and im not sure how to most effectively send this over email ( in case you all wanted to re-produced the error). the main error is Error: /nocurrentpoint in --lineto-- here is the whole error thanks alex -- In [774]: savefig ('output.eps', format='eps') GPL Ghostscript 8.70: Unrecoverable error, exit code 1 RuntimeError: ghostscript was not able to process your image. Here is the full report generated by ghostscript: GPL Ghostscript 8.70 (2009-07-31) Copyright (C) 2009 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Loading CenturySchL-Roma font from /var/lib/defoma/gs.d/dirs/fonts/c059013l.pfb... 3081280 1718017 6003072 4188814 1 done. Error: /nocurrentpoint in --lineto-- Operand stack: 178.896 120.362 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 % oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- % errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:5/6(ro)(L)-- --dict:178/300(L)-- --dict:44/200(L)-- --dict:7/7(L)-- Current allocation mode is local Last OS error: 2 Current file position is 34416 -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Dual x-axes with transformation
Brilliant, that worked perfectly! Thanks very much, Sarah Jae-Joon Lee wrote: You need to define your own transform. And the best way is to read through the transforms.py. Here is a modified version of your example that uses a custom transform. However, often you may need to use a custom locator also for this kind of transform. HTH, -JJ from matplotlib.transforms import Transform, BlendedGenericTransform, IdentityTransform c = 3.e2 class Freq2WavelengthTransform(Transform): input_dims = 1 output_dims = 1 is_separable = False has_inverse = True def transform(self, tr): return c/tr def inverted(self): return Wavelength2FreqTransform() class Wavelength2FreqTransform(Freq2WavelengthTransform): def inverted(self): return Freq2WavelengthTransform() import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost aux_trans = BlendedGenericTransform(Freq2WavelengthTransform(), IdentityTransform()) fig = plt.figure(2) ax_GHz = SubplotHost(fig, 1,1,1) fig.add_subplot(ax_GHz) ax_GHz.set_xlabel(Frequency (GHz)) import numpy as np xvals = np.arange(199.9, 999.9, 0.1) #make some test data data = np.sin(0.03*xvals) ax_mm = ax_GHz.twin(aux_trans) ax_mm.set_xlabel('Wavelength (mm)') ax_mm.set_viewlim_mode(transform) ax_mm.axis[right].toggle(ticklabels=False) ax_GHz.plot(xvals, data) ax_GHz.set_xlim(200, 1000) plt.draw() plt.show() On Wed, May 26, 2010 at 7:24 AM, Sarah Graves sf...@cam.ac.uk wrote: Hi, I've made a matplotlib plot with frequency on the x-axis, and I would like to add an additional x-axis at the top that is measured in wavelength , i.e. wavelength = 3e8 / frequency Is there anyway to do this transformation automatically in matplotlib? I tried to give a transformation argument to the ax.twin() axes_grid command, as shown in the axes_grid parasite_simple2.py example, but I've not managed to get this to work with a transformation more complicated than a scaling by a constant factor. I tried looking at the matplotlib.transforms documentation but I couldn't see a way to do this transformation there. I'm not sure I understood it very well though. I can't simply use the twiny( ) command and manually set the limits as the wavelength ticks will not occur at the points corresponding to the correct frequency. At the moment I am using the twin() command, and then I manually choose a sensible set of tickvalues I want in wavelength units, calculate the corresponding frequency values, and then set the tick locations to be the frequency values and the tick labels to be the wavelength values. Thanks, Sarah Example code: import numpy as np import matplotlib from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost import matplotlib.pyplot as plt #create xaxis range of values -- 200 -- 1000 Ghz xvals = np.arange(199.9, 999.9, 0.1) #make some test data data = np.sin(0.03*xvals) #set up the figure fig = plt.figure() ax = SubplotHost(fig, 111) fig.add_subplot(ax) ax2 = ax.twin() #plot data ax.plot(xvals, data) ax.set_xlim(200.0, 1000.0) #set up ax2 with chosen values wavelength_labels = np.array([0.4, 0.6, 0.8,1.0,1.2, 1.4]) #in mm frequency_points = 3e2/wavelength_labels #in GHz ax2.set_xticks(frequency_points) ax2.set_xticklabels(wavelength_labels) ax2.set_xlabel('Wavelength (mm)') ax.set_xlabel('Frequency (GHz)') plt.show() -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Compiling matplotlib against 64 bit python 2.6 on OSX Snow Leopard
On Wed, May 26, 2010 at 10:47 AM, Pim Schellart p.schell...@gmail.com wrote: Dear John and George, I am happy to report that everything is now working! The latest SVN patch fixed the fetch problem and a complete removal of my custom compiled libpng and libfreetype2 followed by: sudo make -f make.osx fetch deps mpl_build mpl_install sudo python setup.py install did the rest. Thank you for all your help! Kind regards, Pim Schellart P.S. I am looking forward to seeing 64 binaries for Python 2.6/2.7 and numpy/scipy/matplotlib on OSX 10.6 at some point in the future :) Well, now you can make them yourself :-) make -f make.osx binaries But we will try to get some official ones out in the near future. JDH -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mac backend problems for nearly all backends.
A quick update on Mac backends: 1) Two others in my office use macports, python 2.6, mpl 99.1, and snowleopard. They have none of the issues I have with the GUI stuff. Most notably, their MacOSX backends work properly in both X11 and native Mac terminal. 2) I cannot follow up on WxPython or Qt4 for my PPC machine; installs failed for both. I'm working on it some more but have limited time to play around. 3) A recompile of python through fink using updated gcc/g++ (from 4.0 to 4.2) had no effect. While I don't want to drag this thread on forever, I feel like some of this info is useful for the Mac/MPL community. I would love to hear from anyone else who has the OSX backend problem; it seems to be isolated to Fink. It seems like the bottom line is that depending on your install, some experimentation is required to determine which GUI backends work well or at all. On Tue, May 25, 2010 at 10:51 PM, Daniel Welling dantwell...@gmail.comwrote: 2) In which case, it's not a framework install. Fink puts everything into /sw/; there's nothing to do with pyton in /Library/Frameworks. Thanks for the clarification; I'm tempted to get Python from source and try this... -dw On Tue, May 25, 2010 at 10:41 PM, Michiel de Hoon mjldeh...@yahoo.comwrote: 1)The problem does manifest in the same manner through the normal python prompt. OK that is good to know. 2) I'm not sure what is meant by a framework install. Everything (except MPL 99.1.1) was installed through fink. This is important. Check where python is installed. If 'which python' shows /Library/Frameworks/Python.framework/Versions/2.6/bin/python or something similar, you have a framework version. If on the other hand it shows /usr/bin/python, /usr/local/bin/python, or something similar, you don't have a framework version. I don't know what fink installs by default. If you don't have Python installed as a framework, some backends (including the MacOSX backend) will not interact properly with the window manager. This is a Mac peculiarity. If you build Python from source, you can specify to install a framework version by passing the --enable-framework option to the configure script. 6) Although I use x11 and not the native Mac terminal, I'm not sure if this requires me to install different packages for the gui stuff. Could you guys expand on this, please? Some backends go make use of X11 (e.g., the gtkcairo backend), others do not (e.g., the MacOSX backend). The MacOSX backend should work with both the native Mac terminal and with an X11 terminal. --Michiel. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] interpolate inside a circle
Thanks Fabrice. I can interpolate my data using rbf, but only inside a rectangular area (mesh). I'm looking into how to interpolate data inside a circular area, that is, disregarding anything outside a circle (or a polygon, like a convex hull) tks Carlos On Wed, May 26, 2010 at 09:29, Fabrice Silva si...@lma.cnrs-mrs.fr wrote: Le mardi 25 mai 2010 à 21:47 -0300, Carlos Grohmann a écrit : Dears, I want to interpolate some irregular data using radial basis. Can I interpolate only the data that falls inside a circle (or a polygon)? May these pages help you? http://www.scipy.org/Cookbook/RadialBasisFunctions http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano Linux User #89721 Can’t stop the signal. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mac backend problems for nearly all backends.
Daniel Welling wrote: A quick update on Mac backends: While I don't want to drag this thread on forever, I feel like some of this info is useful for the Mac/MPL community. I would love to hear from anyone else who has the OSX backend problem; it seems to be isolated to Fink. I'm still a bit confused -- are you having MPL problems or GUI toolkit problems? i.e. do wx, gtk, qt, etc work just fine for non-MPL applications. If so then there is an MPL issue which it would be nice to resolve. If not, then you have GUI toolkit issues, which should be addressed by the fink and/or GUI toolkit developers. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] projection question
Hi This probably belongs in Proj mailing list, but . I want to specify a line/sample horizontal/vertical tile in a 1 Km resolution sinusoidal projection and get back a lat/lon. Anyone know how to do this? Mathew -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] overlapping text in pie plot
On Mon, May 24, 2010 at 10:04 AM, Fredrik Pihl pi.arc...@gmail.com wrote: some googling gives this thread: http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg16191.html but that doesn't solve the problem, just makes it different... Different, but much easier to solve. Unfortunately, Matplotlib does not provide any solution for now. If you're familiar with Python and matplotlib, you may try to code it by yourself. Otherwise, it may better find other library that does this for you. Regards, -JJ -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Show() in emacs
My near-newbie suspicion is that you're using more tools than you need and having them interfere with each other. The show() command generally doesn't return control to whatever called it until you've closed the shown window (http://bytes.com/topic/python/answers/635142-matplotlib-basic-question ). if running ipython -pylab from a terminal, successive plot commands display a window with the successively plotted lines in it; if I start the python interpreter from an emacs file in Python-mode, and import pylab, and plot() twice, I also get a single figure window with the successively plotted lines in it -- *until* I switch focus to the figure window, after which calling plot() from the interpreter doesn't do anything to the figure until I close the first figure. (This does seem buggy, or at least suboptimal. I'm using Aquamacs on OS X, don't know if the same interpreter would be called on ubuntu.) Practically speaking, I use the interpreter to check tiny bits of syntax, ipython to noodle around with more complicated syntax or reasoning, and M-! from emacs to execute a whole .py file that I know is mostly right. I hardly ever use show() at all, but rather savefig(), with a file-directory window showing me the results as I go. If that doesn't work for you, the experts probably need a more precise bug report to figure out what would. Chloe Lewis Grad student, ESPM, UC Berkeley On May 25, 2010, at 8:40 PM, Ted Rosenbaum wrote: Hi, I am a real newbie at matplotlib, so I apologize if this is an obvious question. I am running ipython in emacs and while the first time I use the show() command in the ipython buffer the graph shows up fine, subsequent times that I call the command it, the graph does not show up. I am on ubuntu 10.04 (64) and I built the matplotlib library from source. I am trying to get the graphs to show up the subsequent times as well (sorry for the pun). Thanks for any help. Ted Rosenbaum Graduate Student Department of Economics Yale University -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] interpolate inside a circle
On 26 May 2010 17:20, Carlos Grohmann carlos.grohm...@gmail.com wrote: I can interpolate my data using rbf, but only inside a rectangular area (mesh). I'm looking into how to interpolate data inside a circular area, that is, disregarding anything outside a circle (or a polygon, like a convex hull) If you can define your polygon/circle, you can filter your points and select only those within the boundary. You can do this with pnpoly if you have matplotlib (see this: http://matplotlib.sourceforge.net/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon). You can then interpolate your points, into a regular grid, and discard the gridcell values outside your region of interest. J -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Show() in emacs
On Tue, May 25, 2010 at 10:40 PM, Ted Rosenbaum ted.rosenb...@yale.edu wrote: Hi, I am a real newbie at matplotlib, so I apologize if this is an obvious question. I am running ipython in emacs and while the first time I use the show() command in the ipython buffer the graph shows up fine, subsequent times that I call the command it, the graph does not show up. I am on ubuntu 10.04 (64) and I built the matplotlib library from source. I am trying to get the graphs to show up the subsequent times as well (sorry for the pun). Thanks for any help. Take a look at http://matplotlib.sourceforge.net/users/shell.html It may help to configure your matplotlib backend to TkAgg. See http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend http://matplotlib.sourceforge.net/users/customizing.html Also, you will probably want to figure out how to make emacs launch ipython in pylab mode, in which case you won't need show at all. ipython will take care of everything for you in pylab mode. JDH -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Finding fonts
When I plot, I get: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) My matplotlibrc file has: font.sans-serif: Computer Modern Sans Serif font.serif: Computer Modern Roman font.monospace: Computer Modern Typewriter Have I typed these names incorrectly? I recently (two days ago) upgraded to the latest SVN of matplotlib and that is when the warning started appearing. I have a working TeXLive distribution in linux, so the fonts should exist on my computer. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Show() in emacs
Jonn-- Thanks very much. Customizing the backend to TkAgg solved the problem. Chloe--thanks for your advice as well! On Wed, May 26, 2010 at 3:21 PM, John Hunter jdh2...@gmail.com wrote: On Tue, May 25, 2010 at 10:40 PM, Ted Rosenbaum ted.rosenb...@yale.edu wrote: Hi, I am a real newbie at matplotlib, so I apologize if this is an obvious question. I am running ipython in emacs and while the first time I use the show() command in the ipython buffer the graph shows up fine, subsequent times that I call the command it, the graph does not show up. I am on ubuntu 10.04 (64) and I built the matplotlib library from source. I am trying to get the graphs to show up the subsequent times as well (sorry for the pun). Thanks for any help. Take a look at http://matplotlib.sourceforge.net/users/shell.html It may help to configure your matplotlib backend to TkAgg. See http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend http://matplotlib.sourceforge.net/users/customizing.html Also, you will probably want to figure out how to make emacs launch ipython in pylab mode, in which case you won't need show at all. ipython will take care of everything for you in pylab mode. JDH -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] To modify 'extend' in a 2D plot
Dear Matplotlib users, I need to plot a (time x distance) array of measurements associated with a color bar. Although time is fixed (i.e 0, 1, 2, etc..), to the number of rows, the distances are not evenly distributed (e.g are fixed to 1.22, 1.53, 1.84, 2,11.), although are always constant. My question is simple. How can I modify the 'extent ' argument so that I represent the real distance values, and not simply evenly distributed events? Any suggestion or comment would be greatly appreciated! A minimal example plot is given bellow: Thanks a lot in advance Jose. #= import matplotlib.pyplot as plt import numpy as np # fake data random = np.random.randint(0, 300, size=(55,127) fig = plt.figure() ax = fig.add_subplot(111) myaspect = 100.0 # How can adjust this data to my REAL distances # (e.g 1.22, 1.53, 1.84, 2,01) ???. myextent=[-400,800,0,10] cax = ax.imshow(random, aspect = myaspect, extent=myextent, vmin=0, vmax=300) ax.set_ylabel('Time (ms)') ax.set_xlabel('Distance (mm)') colorbar = fig.colorbar(cax, ticks=[0,100,200,300,400]) colorbar.ax.set_yticklabels(['0','100','200','300','400']) colorbar.ax.set_ylabel('Measurement') plt.show() #= -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] To modify 'extend' in a 2D plot
On 05/26/2010 12:31 PM, Jose Guzman wrote: Dear Matplotlib users, I need to plot a (time x distance) array of measurements associated with a color bar. Although time is fixed (i.e 0, 1, 2, etc..), to the number of rows, the distances are not evenly distributed (e.g are fixed to 1.22, 1.53, 1.84, 2,11.), although are always constant. My question is simple. How can I modify the 'extent ' argument so that I represent the real distance values, and not simply evenly distributed events? It sounds like you need to use the NonUniformImage: http://matplotlib.sourceforge.net/examples/pylab_examples/image_nonuniform.html Eric Any suggestion or comment would be greatly appreciated! A minimal example plot is given bellow: Thanks a lot in advance Jose. #= import matplotlib.pyplot as plt import numpy as np # fake data random = np.random.randint(0, 300, size=(55,127) fig = plt.figure() ax = fig.add_subplot(111) myaspect = 100.0 # How can adjust this data to my REAL distances # (e.g 1.22, 1.53, 1.84, 2,01) ???. myextent=[-400,800,0,10] cax = ax.imshow(random, aspect = myaspect, extent=myextent, vmin=0, vmax=300) ax.set_ylabel('Time (ms)') ax.set_xlabel('Distance (mm)') colorbar = fig.colorbar(cax, ticks=[0,100,200,300,400]) colorbar.ax.set_yticklabels(['0','100','200','300','400']) colorbar.ax.set_ylabel('Measurement') plt.show() #= -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding fonts
On 05/26/2010 04:47 PM, T J wrote: When I plot, I get: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) My matplotlibrc file has: font.sans-serif: Computer Modern Sans Serif font.serif: Computer Modern Roman font.monospace: Computer Modern Typewriter Have I typed these names incorrectly? I recently (two days ago) upgraded to the latest SVN of matplotlib and that is when the warning started appearing. I have a working TeXLive distribution in linux, so the fonts should exist on my computer. The warning was recently introduced in SVN, but the behaviour shouldn't have changed -- it's just a little more in your face now that something may not be what you expect. TeXLive doesn't usually install Truetype versions of the Computer Modern fonts. You can use the Computer Modern Bakoma fonts that come with matplotlib by using cmr10, cmss10 etc. (see mpl-data/fonts/ttf for a list of the available ones), or for fonts that are a little more friendly and have standard unicode character points, you may want to install these: http://cm-unicode.sourceforge.net/ Or, you can side-step all this and set the rcParam text.usetex to True, which will render all the text in the plot with TeX itself. Mike -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mac backend problems for nearly all backends.
I am using the EPD and have have an issue with saving( I cant type in a name for the file) Are you using the 64bit? I don't think wx runs in 64 bit and so something else is used in the EPD 64 distro. Not really clear on this and has been awhile since I looked at it. On Tue, May 25, 2010 at 12:51 PM, Daniel Welling dantwell...@gmail.comwrote: $%$^#!!! My sincere apologies, gmail sent before I was ready. To continue: GtkCairo: looks great, crashes ipython on resize. Wx: color issues, not stable. Qt: installs from fink, but won't load. In any case, it's not the Gtk/Qt/Wx problems that are important, it's the OSX backend issue. Others whom I work with do not have this issue, but installed using EPD. Has anyone else experienced such problems? Thanks for your help; let me know if there's more info I can provide. -dw On Tue, May 25, 2010 at 12:47 PM, Daniel Welling dantwell...@gmail.comwrote: Greetings. I did quite a bit of digging on this and cannot find similar problems, but if I did miss an earlier discussion, then I apologize. In any case, I have been having royal problems with GUI backends and matplotlib. Some background on where I've been having these problems: Machine 1: OSX 10.5.8 G5 PPC Machine 2: OSX 10.5.7 Macbook pro/Intel Code versions: python 2.5.4, Numpy 1.3.0, Scipy 0.7.0 (all obtained through fink.) MPL versions: 99.0.1 and 99.1.1 (Older obtained through fink, newer installed from source.) Here are the issues; behavior is consistent on both machines: MacOSX backend: Loads plots quickly, but when I try to save, I cannot type in the file name area of the save file dialog. Furthermore, with ipython, I can continue to use the ipython prompt up until the I shut the plot window. ipython then freezes until I control-c it. This occurs in both versions. TkAgg backend: In 99.0.1, this works fine. However, it is slow, hence my want for a different working backend. in 99.1.1, the plot window opens but the picture is never drawn. After a moment, segfault back to the x11 prompt. Blerg. GtkAgg: Bad color (e.g. the background is pink rather than gray, color tables are way goofed up. Writes to file fine.) -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users *Vincent Davis 720-301-3003 * vinc...@vincentdavis.net my blog http://vincentdavis.net | LinkedInhttp://www.linkedin.com/in/vincentdavis -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mac backend problems for nearly all backends.
We can actually check from Python whether it's a framework install or not. import MacOS MacOS.WMAvailable() returns True if it's a framework install, False if not. I can add this check to the MacOSX backend and print out a warning if it's not a framework install. --Michiel --- On Wed, 5/26/10, Daniel Welling dantwell...@gmail.com wrote: From: Daniel Welling dantwell...@gmail.com Subject: Re: [Matplotlib-users] Mac backend problems for nearly all backends. To: Michiel de Hoon mjldeh...@yahoo.com Cc: matplotlib-users@lists.sourceforge.net Date: Wednesday, May 26, 2010, 12:51 AM 2) In which case, it's not a framework install. Fink puts everything into /sw/; there's nothing to do with pyton in /Library/Frameworks.Thanks for the clarification; I'm tempted to get Python from source and try this... -dw On Tue, May 25, 2010 at 10:41 PM, Michiel de Hoon mjldeh...@yahoo.com wrote: 1)The problem does manifest in the same manner through the normal python prompt. OK that is good to know. 2) I'm not sure what is meant by a framework install. Everything (except MPL 99.1.1) was installed through fink. This is important. Check where python is installed. If 'which python' shows /Library/Frameworks/Python.framework/Versions/2.6/bin/python or something similar, you have a framework version. If on the other hand it shows /usr/bin/python, /usr/local/bin/python, or something similar, you don't have a framework version. I don't know what fink installs by default. If you don't have Python installed as a framework, some backends (including the MacOSX backend) will not interact properly with the window manager. This is a Mac peculiarity. If you build Python from source, you can specify to install a framework version by passing the --enable-framework option to the configure script. 6) Although I use x11 and not the native Mac terminal, I'm not sure if this requires me to install different packages for the gui stuff. Could you guys expand on this, please? Some backends go make use of X11 (e.g., the gtkcairo backend), others do not (e.g., the MacOSX backend). The MacOSX backend should work with both the native Mac terminal and with an X11 terminal. --Michiel. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users