From: David G. <d_l...@ya...> - 2008-09-06 18:14:28
|
Oh, forgot to mention: same code works fine on a smaller (fewer pixels) image. DG --- On Sat, 9/6/08, David Goldsmith <d_l...@ya...> wrote: > From: David Goldsmith <d_l...@ya...> > Subject: [Matplotlib-users] imshow size limitations? > To: mat...@li... > Date: Saturday, September 6, 2008, 10:46 AM > Hi! I'm trying to display a 10800 x 8100 pixel image w/ > imshow using the following code (adapted from a response to > a previous post of mine): > > from matplotlib.backends.backend_agg import FigureCanvasAgg > as FigureCanvas > from matplotlib.figure import Figure > > fig = Figure(figsize=(36,27), > dpi=300, > frameon=False) > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111, xticks=[], yticks=[]) > cmap = MPL.cm.get_cmap('prism_r') > ax.imshow(result, cmap=cmap) > canvas.print_figure('HiResHex') > > I get the following error report: > > Traceback (most recent call last): > File "Hex.py", line 208, in <module> > canvas.print_figure('HiResHex') > File > "C:\python25\lib\site-packages\matplotlib\backend_bases.py", > line 1201, i > n print_figure > self.figure.canvas.draw() > File > "C:\python25\lib\site-packages\matplotlib\backends\backend_agg.py", > line > 358, in draw > self.figure.draw(self.renderer) > File > "C:\python25\lib\site-packages\matplotlib\figure.py", > line 624, in draw > for a in self.axes: a.draw(renderer) > File > "C:\python25\lib\site-packages\matplotlib\axes.py", > line 1305, in draw > for im in self.images if im.get_visible()] > File > "C:\python25\lib\site-packages\matplotlib\image.py", > line 131, in make_im > age > x = self.to_rgba(self._A, self._alpha) > File > "C:\python25\lib\site-packages\matplotlib\cm.py", > line 75, in to_rgba > x = self.norm(x) > File > "C:\python25\lib\site-packages\matplotlib\colors.py", > line 593, in __call > __ > val = ma.asarray(value).astype(npy.float) > File > "C:\python25\lib\site-packages\numpy\core\ma.py", > line 1151, in astype > d = self._data.astype(tc) > MemoryError > > Is there some maximum number of pixels imshow can handle? > Any other suggestions? > > Platform Details: MPL 0.91.2 (sorry, I didn't realize I > was running such an old version, maybe I just need to > upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB physical > RAM, 1294MB VM Page size (1000MB init., 5000MB max) > > Thanks! > > DG > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > Build the coolest Linux based applications with Moblin SDK > & win great prizes > Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |