Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica 6: No more memory available problem with ListDensityPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88864] Re: [mg88850] Mathematica 6: No more memory available problem with ListDensityPlot
  • From: echinococcus Multilocularis <lintworm2 at yahoo.co.uk>
  • Date: Mon, 19 May 2008 06:45:43 -0400 (EDT)

Hello Kezhao,

All though the dataset might not be too large, a problem is
the fact that the new version of ListDensityPlot in Mathematica (6.0) will
make polygons of each of the pixels. Now for smaller images this already
generates a lot of memory-consumption, but especially when your
image is quite large it will eat away everything you've got in your memory. 

A better way to solve this problem would be to use ArrayPlot. This function has similar behavior as the old ListDensityPlot. The only difference is that it considers Arrays, and not Images. You can see this difference in the the way coordinates are used within the image. An image plotted with arrayplot appears to be upside down. To solve this, set the option DataReversed to True.  

Another solution would be to use the package MathVisionTools, which has 
a function called RasterPlot, which does the same thing as ArrayPlot, but is slightly faster. MathVisionTools is developed at the Technical University of Eindhoven (Netherlands) and can be downloaded from www.mathvisiontools.net
(you will have to acquire a login code from the authors).  

RandomReal[{0,1},{78,20003}];
Dimensions[d]
ArrayPlot[d,AspectRatio=C2=AE 0.3,ColorFunction=C2=AE"Rainbow",DataReversed=C2=AETrue]

HTH,

Gao


  • Prev by Date: Re: An Elegant way of plotting the Pole-Zero diagram
  • Next by Date: Re: Possible Bug Report: CoefficientList
  • Previous by thread: Mathematica 6: No more memory available problem with ListDensityPlot
  • Next by thread: MathLink Wrapper