MathGroup Archive 1998

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

Search the Archive

Re: Question about Mathematica



Nuno Catarino wrote:
> 
> I've recently started to use Mathematica to get some images through the
> command 'ListDensityPlot' and I couldn't find anywhere in the manual
> how to get those images in colours. It doesn't seem to be possible to
> use 'RGBColor' and I can't define properly the spectrum through the
> command 'Hue'. If you could help me on this subject, I would be
> delighted.

Nuno,

You need to use the options.
The list of options is given bu
Options[ListDensityPlot]
But it's probably better to look up ListDensityPlot in the Help Browser.
This will direct you to DensityGraphics, which give all the options.
Then use the Help Browser to find out about the options.

Here is an example.

In[1]:=
data=Table[x,{x,.05,1.95,.1},{y,.25,.75,.5}];

In[2]:=
ListDensityPlot[data,
	ColorFunction -> (Hue[2/3 #]&),
	MeshRange-> {{0,1},{0,2}},
	FrameLabel ->{"y","x"}
]

In[3]:=
ListDensityPlot[data,
	ColorFunction -> (Hue[2/3 #]&),
	PlotRange -> {.5,1.5},
	FrameLabel ->{"y","x"}
]

Notes:
Hue[0] = red then through the spectrum to and back to red for Hue[1], so
to stop at Blue, I scale the inputs by 2/3.

The function Hue[2/3 #]& receives the data entries after they have been 
1. truncated to PlotRange
2  then scaled to [0,1] from lowest to highest of the truncated values.

MeshRange-> {{0,1},{0,2}} give the  horixontal and vertical ranges for
the ticks in the display (default is {{0, Number of columns},{0, Number
of rows}}).

The data is displayed with rows running bottom to top and columns left
to right.



-- 
Allan Hayes
Mathematica Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642



  • Prev by Date: Re: exponential rule application
  • Next by Date: RE: Q:ReadList is reading spaces with numbers - what do I do?
  • Prev by thread: RE: Question about Mathematica
  • Next by thread: exponential rule application