MathGroup Archive 1999

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

Search the Archive

ListDensityPlot[ ] and DensityGraphics

  • To: mathgroup at
  • Subject: [mg16979] ListDensityPlot[ ] and DensityGraphics
  • From: Maarten.vanderBurgt at
  • Date: Sat, 10 Apr 1999 02:13:24 -0400
  • Sender: owner-wri-mathgroup at


I am trying to write a few simple image processing routines in Mathematica.
Doing this I came across a few problems using ListDensityPlot and
displaying DensityGraphics.
I will explain these questions with a simple example.

Below, Data is a 50 x 256 array of grey values ranging from 0 to 255.
Using ListDensityPlot, I make DensPl to visualise this.

In[1]:= Data = Table[j,{i,0,49},{j,0,255}];

In[2]:= DensPl =ListDensityPlot[data, Mesh ->False,
Frame->False,ImageSize->{256,50}, PlotRange->{0,255},

I am using Mathematica 3.01 on a Windows NT4 PC.

I have the following questions:

DensPl is a band going from black on the left to white on the right. But
there are some additional vertical black lines in the centre of the plot.
These lines disappear when I make the plot bigger by selecting it with the
mouse and stretching it to say 1.2 times the original size. I get more
vertical lines when I make the plot smaller in a similar way.
This seems to be an error/artefact in some interpolation routine when the
image is resized. This is rather annoying in real life images since from
the display you can not see what is real and what is a display artefact.
Is there a way to get rid of this artefact?

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?

- using the "True Color" setting on my display DesnPl is going smoothly
from black on the left to white on the right.

- using the "16777216 Colors" DensPl is completely black (this is known but
I do not know the reason: see "[mg15538] Re: ListDensityPlot gives
PostScript error" from January 26 this year.).
Does anyone know the difference between "True Color" and "16777216 Colors"?
I always thought it is the same: true color = 24 bit color = 2^24 =
16777216 colors.
My PC's/graphics card documentation doesn't tell me.

- using the "65536 Colors" (16 bit) setting, DensPl shows approx. 30
vertical bands with a different grey intensity: it does not vary smoothly
any more from black to white. I do have other graphics applications which
have no problem with images showing a smooth grey level variation using the
16 bit color setting. Why has Mathematica problems doing this?

Any help is greatly appreciated




Maarten van der Burgt

R&D Department

ICOS Vision Systems
Esperantolaan 9
B-3001 Leuven
tel.    + 32 16 398220       direct  + 32 16 398316     fax.    + 32 16
e-mail: maarten.vanderburgt at


  • Prev by Date: ParametricPlot help please
  • Next by Date: Re: Scheduling algorithms
  • Previous by thread: Re: ParametricPlot help please
  • Next by thread: ListDensityPlot[ ] and DensityGraphics