Re: [Matplotlib-users] ANN: Michael Droettboom, matplotlib lead developer
On Aug 2, 2012, at 5:25 PM, John Hunter wrote: I also extend my heartfelt thanks to Perry Greenfield and STScI. They have been supporting matplotlib since 2004 with ideas, code and developer resources. They employ Michael currently, and are part of the reason why he is able to take on the leadership of this large project. John, it has been our great fortune have joined the matplotlib effort. It saved us an enormous effort. It has been an incredible pleasure working with you. I'm not sure you realize how very much Mike and I hope you can rejoin the matplotlib effort. It will always be there for you. Perry -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [AstroPy] import problem (matplotlib ? numpy ?) on Mac Intel, python 2.6
matplotlib or numpy aren't going to work with jython. On May 16, 2011, at 11:02 AM, Jean-Baptiste Marquette wrote: Dear matplotlib/numpy gurus, This is my first attempt to use matplotlib numpy, with the following small piece of code: #!/usr/bin/env jython jython because of the import of stilts from starjava # Fabrique les figures des champs du papier Catalogue __author__=marquett __date__ =$16 mai 2011 12:17:08$ import sys sys.path.append('/star/starjava/etc/ttools') sys.path.append('/Library/Frameworks/Python.framework//Versions/2.6/ lib/python2.6/site-packages') import stilts import glob import matplotlib.pyplot as plt I got the following trace: Traceback (most recent call last): File /Users/marquett/Downloads/FigCat/src/figcat.py, line 14, in module import matplotlib.pyplot as plt File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/matplotlib/__init__.py, line 135, in module from matplotlib.rcsetup import (defaultParams, File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/matplotlib/rcsetup.py, line 19, in module from matplotlib.colors import is_color_like File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/matplotlib/colors.py, line 52, in module import numpy as np File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/__init__.py, line 137, in module import add_newdocs File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/add_newdocs.py, line 9, in module from numpy.lib import add_newdoc File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/lib/__init__.py, line 4, in module from type_check import * File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/lib/type_check.py, line 8, in module import numpy.core.numeric as _nx File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/core/__init__.py, line 5, in module import multiarray ImportError: No module named multiarray I use the latest 1.6.0 version of numpy and 1.0.0 one of matplotlib. My so little experience tells me that this is a deep numpy issue rather than a matplotlib one. Any hint welcome, thanks. JB Marquette ___ AstroPy mailing list astr...@scipy.org http://mail.scipy.org/mailman/listinfo/astropy -- Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Memory issues with imshow
On Dec 15, 2009, at 1:09 PM, Gerd Wellenreuther wrote: Perry Greenfield schrieb: if the above code is in a loop, and there is no figure clearing in the loop, then rotated_images[i] = [] gc.collect(2) will have no effect since matplotlib will still have references to the array (and generally, you never need to call gc.collect by the way). I do / did not know whether matplotlib is actually refering to my array (in that context dereferencing it will not free memory), or actually copying the data at one instance (in that case it should help). So, as you can see I am lacking the inside-knowledge of matplotlib, and was just trying some things which were not doing any harm (at least this is what I suppose). To give an idea, when you ask matplotlib to render an image, it processes it (resamples, rescales, maps to colors, etc) in order to actually display it. Since it may redo all that if you resize or otherwise re-render the figure, it needs to keep a reference to the original image. Even if you delete your reference to it, it still has it, and thus it won't be deleted until the figure is cleared. So if the input to the imshow call is the full size array, you will have that around. You may want to downsample that image to lower resolution (and make sure that the downsampled version is a copy, not a view of the original array). Then you can get rid of the original image, and instead display the smaller version. Keeping that around won't impact memory. But I would expect that figure clearing would not only free memory, but also erase the formerly inserted images, right? *That* would harm ;). Yes, it would erase it :-) Perry -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Memory issues with imshow
On Dec 15, 2009, at 12:30 PM, Wellenreuther, Gerd wrote: Hi Perry, to clarify what I am doing - maybe the error lies in here: * First I am building up a list of the corrected+rotated images * After that is done I am creating the figure * Then looping over every image, creating proper axes for each individual image and finally: pylab.imshow(rotated_images[i],aspect='auto') rotated_images[i]=[] gc.collect(2) So I am trying to immediately delete the now obsolete image-data, by removing the reference and forcing garbage collection. No idea whether this is the proper/best way to do it ... but at least I hope my intention is clear :). Anyone an idea how to improve? if the above code is in a loop, and there is no figure clearing in the loop, then rotated_images[i] = [] gc.collect(2) will have no effect since matplotlib will still have references to the array (and generally, you never need to call gc.collect by the way). What isn't clear to me in this is how you handle the offsetting and combining of images. Normally imshow will just display one image right over the other. Can you just insert the appropriate subsampled image into one output image, and then display that. After the insertion, you can delete the input image inside the loop. Perry -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting large images
Because the image is so large, and matplotlib carries out various operations on the image (scaling, resampling, etc), it uses a lot of memory. This is one area where a specialized display program will be more efficient. If you need to use matplotlib, decide whether you really only want to display a subsection, or only need a lower resolution version (e.g., boxcar smooth and subsample) before displaying. I've found that image sizes well over 1kx1k can take some time to display, and those that are much larger can cause you to run out of memory. At least, that's what I think is happening. Perry On Jun 30, 2009, at 7:20 PM, Tommy Grav wrote: I am trying to use imshow to plot some semi-large fits images. Here is the code: from math import * import numpy as np from matplotlib import pyplot as plt from matplotlib import cm as cm import pyfits cat = /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/ fname = o4985g0263o.warp.MD09.skycell.092 hdu = pyfits.open(cat+fname+.fits) print hdu.info() img = hdu[1].data.astype(int) plt.figure(figsize=[12,12]) plt.imshow(img,cmap=cm.cool) plt.savefig(test.png) Which gives the result: Filename: /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/ o4985g0263o.warp.MD09.skycell.092.fits No.Name Type Cards Dimensions Format 0PRIMARY PrimaryHDU 6 ()int16 1CompImageHDU 101 (6000, 6000) float32 None Python(23117,0xa04f2720) malloc: *** mmap(size=115200) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Traceback (most recent call last): File quick_look.py, line 16, in module plt.savefig(test.png) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/pyplot.py, line 345, in savefig return fig.savefig(*args, **kwargs) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/figure.py, line 990, in savefig self.canvas.print_figure(*args, **kwargs) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backend_bases.py, line 1419, in print_figure **kwargs) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backends/backend_agg.py, line 323, in print_png FigureCanvasAgg.draw(self) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/backends/backend_agg.py, line 279, in draw self.figure.draw(self.renderer) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/figure.py, line 772, 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 1545, in draw im.draw(renderer) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/image.py, line 233, in draw im = self.make_image(renderer.get_image_magnification()) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/image.py, line 180, in make_image x = self.to_rgba(self._A, self._alpha) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/cm.py, line 79, in to_rgba x = self.cmap(x, alpha=alpha, bytes=bytes) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/colors.py, line 501, in __call__ rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype) MemoryError I found the earlier thread of http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg11216.html but that didn't seem to produce any fixes or good explanations. I am on a Mac Pro Intel machine running 10.5.7 and [Heimdall:tgrav ~/Work/myCode/Python/pyPS1SC] python ActivePython 2.5.4.3 (ActiveState Software Inc.) based on Python 2.5.4 (r254:67916, Jan 20 2009, 14:11:42) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type help, copyright, credits or license for more information. import numpy numpy.__version__ '1.3.0rc2' import pyfits pyfits.__version__ '2.1.1dev462' import matplotlib matplotlib.__version__ '0.98.5.2' Cheers Tommy -- ___ 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] Plotting large images
On Jun 30, 2009, at 7:54 PM, Tommy Grav wrote: That is what I was assuming, but it still seems a little odd that matplotlib generates that large of a memory footprint. Loading the fits file into the program using pyfits, with the code only uses 19MB of real memory and 600MB of virtual memory (strangly adding the line img = hdu[1].data, increases this to 208MB/800MB). The reason for this is that pyfits doesn't actually load the data until you 'touch' the data attribute (to minimize memory, particularly if you just are interested in the header information). As for the memory footprint of matplotlib, in order to be able to resize and handle interactive updates, it has to retain references to the original image, perhaps as well to intermediate products (and these references won't be memory collected until you clear the figure (e.g., clf()). It's one of the prices for flexibility and generality. It probably would take a lot of complexity to optimize it for large images (but John is better suited to answer this conclusively). Perry Displaying images of various sizes I get these numbers from Activity Monitor Size Real Mem Virtual 3k x 3k 0.68GB1.57GB 4k x 4k 0.92GB1.80GB 5k x 5k 1.20GB2.10GB 5.5k x 5.5k 1.38GB2.28GB And the limit seems to be somewhere just above 5.5k by 5.5k (darn :( ) Cheers Tommy -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] histogram question
On Sep 24, 2007, at 2:32 PM, Tommy Grav wrote: I need to generate a set of histograms, but would like to plot only the skyline of the histogram, and leave out the vertical lines where adjencent bars touch. I have looked at the docs, but nothing jumped out at me as the right keyword for this. Is this possible? and if so, how? I believe that you can do the same thing using the regular plot command with linestyles='steps' (but I think you need to fiddle with the x values so that the steps are aligned properly. But it would be nice if hist could do this too. Perry - 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/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] numpy version of Interactive Data Analysis tutorial available
I have updated the Using Python for Interactive Data Analysis tutorial to use numpy instead of numarray (finally!). There are further improvements I would like to make in its organization and formatting (in the process including suggestions others have made to that end), but I'd rather get this version out, which I believe addresses all the content changes needed to make it useful for numpy, without delaying it any further. The tutorial, as well as other supporting material and information, can be obtained from: http://www.scipy.org/wikis/topical_software/Tutorial I'm sure errors remain; please let me know of any you find. Perry - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] job opportunity at Space Telescope Science Institute
We are looking for someone to fill a position at the Space Telescope Science Institute (in Baltimore, MD) to work on Python tools for astronomical data processing and analysis. Details can be found at: http://www.stsci.edu/institute/brc/hr/co/external/Req559.html - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users