From: Max on
Hi guys,

I am making a scatter plot of a series of data points.
I was wondering if there was a way in which I could have a colour gradient on the points based on another parameter.
For example say I plot a point at coordinates (3,2) but I also have another number related to that point and depending on how high that number is the point should be plotted a different colour.

Cheers,
Max
From: Rune Allnor on
On 3 Feb, 06:51, "Max " <calamar...(a)gmail.com> wrote:
> Hi guys,
>
> I am making a scatter plot of a series of data points.
> I was wondering if there was a way in which I could have a colour gradient on the points based on another parameter.
> For example say I plot a point at coordinates (3,2) but I also have another number related to that point and depending on how high that number is the point should be plotted a different colour.

This can be done, with more or less effort, depending
on the type of plot you use.

A lot of the 3D plotting functions take arguments
on a form similar to

mesh(x,y,z,c)

where c(n) denotes the color of the point at position
(x(n),y(n),z(n)).

Even the plotting functions that don't take a color
vector as argument can be manipulated through the
'color' property, but at the expense of more fiddly
coding on your part (and maybe also a longer run-time).

Rune