MATLAB: Color Map for 3 column data

color maps

I have a data file which contains 3 columns – x, y and z. x and y correspond to atom number and position respectively. z corresponds to a calculated quantity. A portion of the file is as shown –
1 7.150846 0.00261065
2 9.901863 0.0150778
3 7.964226 0.0448227
4 7.107278 0.304756
I want to make a color plot in which the position of each atom is colored according to the value in z axis. Can someone please help me with this..
Thanks

Best Answer

data = [1 7.150846 0.00261065
2 9.901863 0.0150778
3 7.964226 0.0448227
4 7.107278 0.304756] ;
x = data(:,1) ; y = data(:,2) ; z = data(:,3) ;
scatter(x,y,50,z,'filled')
colorbar
Related Question