Re: ListDensityPlot[ ] and DensityGraphics
- To: mathgroup at smc.vnet.net
- Subject: [mg17025] Re: [mg16980] ListDensityPlot[ ] and DensityGraphics
- From: Andrew Watson <abwatson at mail.arc.nasa.gov>
- Date: Wed, 14 Apr 1999 02:11:46 -0400
- Sender: owner-wri-mathgroup at wolfram.com
At 11:13 PM -0700 4/9/99, Maarten.vanderBurgt at icos.be wrote: > >2. >With the options Mesh ->False, Frame->False,ImageSize->{256,50}, >AspectRatio->Automatic I was hoping the actual size of the black/grey/white >"colored" area would exactly 50 x 256 pixels on screen (i.e. one element in >matrix Data would correspond to one pixel in the plot on screen). But >around the "colored" area there is a white band of 3-5 pixels wide. I there >a way to get rid of this white band or to control it? > Having confronted the same problem, and having received less than adequate explanatiosn from Wolfram, I concocted the following hack: ShowAbsoluteImage[image_,opts___] := Module[{rows,columns}, {rows,columns} = Dimensions[image]; Show[Graphics[Raster[image] ,opts ,AspectRatio->Automatic ,ImageSize-> {columns,rows} ,PlotRange->{{0,columns},{0,rows}} ,PlotRegion->{{0,(rows+2)/rows},{-1/columns,1}} ]]] The wierd little calculation in PlotRegion appears to remove the band for the sizes I have tried, but there are no guarantees. Of course, if Wolfram would simply tell us what algorithm they use to generate the band, things would be easier... Regards, Andrew B. Watson MS 262-2 NASA Ames Research Center Moffett Field, CA 94035-1000 (650) 604-5419 (650) 604-0255 fax abwatson at mail.arc.nasa.gov http://vision.arc.nasa.gov/