From: Jonathan on
Hi folks,

I've got a dataset that I'd like to represent on a 2-D colored contour plot, but the data are slightly too sparse to really warrant this. Instead, I'd like to plot my points in color, and I'd like the color to be a function of a third variable. I.e.

x y concentration
1 1 0.12
2 9 0.25
3 7 0.93
4 1 0.77

where concentration would be from 0 to 1, with a color bar from red to blue.

Any suggestions on plot scripts already written that might save me a bit of time figuring out how to do this? Or any suggestions on how to go about doing this? The main impediment is not figuring out how to translate concentration into a color value, but figuring out how interface a set of representative color values with a Matlab plot function of some sort.

(Sorry if I've missed previous threads about this, but I haven't been able to find one after a search.)

Many thanks...
Jonathan
From: Matthew on
Use SCATTER

scatter(x,y, size, concentration);
set(gca,'CLim',[0 1]);

"Jonathan " <remove.this.jbent(a)ucsd.edu> wrote in message <hqqr5r$j1l$1(a)fred.mathworks.com>...
> Hi folks,
>
> I've got a dataset that I'd like to represent on a 2-D colored contour plot, but the data are slightly too sparse to really warrant this. Instead, I'd like to plot my points in color, and I'd like the color to be a function of a third variable. I.e.
>
> x y concentration
> 1 1 0.12
> 2 9 0.25
> 3 7 0.93
> 4 1 0.77
>
> where concentration would be from 0 to 1, with a color bar from red to blue.
>
> Any suggestions on plot scripts already written that might save me a bit of time figuring out how to do this? Or any suggestions on how to go about doing this? The main impediment is not figuring out how to translate concentration into a color value, but figuring out how interface a set of representative color values with a Matlab plot function of some sort.
>
> (Sorry if I've missed previous threads about this, but I haven't been able to find one after a search.)
>
> Many thanks...
> Jonathan