4

I have a 3 dimensional data set which I intend to analyse. After analysing the data set, basically running an algorithm to find a range of points, I this range of points to have a specific colour so that when someone sees the surface plot, they know which are the points of interest. How can this be achieved?

I have tried to find some help in the mathworks forums, but so far I am not able to find a satisfactory solution.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
thedorkknight
  • 183
  • 3
  • 12

1 Answers1

3

If you are using the surface function, you can use the 4 parameter version surf(x,y,z,c) where c lets you specify colour based on the currently used colour map. See this link at the mathworks site for more detail http://www.mathworks.co.uk/help/matlab/ref/surf.html

mathematician1975
  • 21,161
  • 6
  • 59
  • 101
  • the input is like this [input](https://www.dropbox.com/s/4tps3znzvdd46s3/untitled.png) and the selected points look like this after the colouring algorithm i am using [output](https://www.dropbox.com/s/yydhr04sc3afr1c/output.png) now what i need is to have the points in the seconds image shown in the first one with a different colour. is that possible? – thedorkknight Nov 13 '12 at 11:21
  • i have tried the method given above by @mathematician1975. it is doing my work halfway. thanks, but i want to colour some points with a different colourmap while preserving the original colourmap as well. – thedorkknight Nov 20 '12 at 10:40
  • I have a good result of what i need. Initially i was indexing the points which i dont need to those corresponding to the lowest on the colourmap, so i was getting a plot with just two (almost) colours. Now i am indexing the points which i need to be coloured, and its working just as expected, without any fancy tricks. Just to change the colour of these points, i have to manually tweak the colourmap, but it is managable. \\ \\ the admins can close this question. – thedorkknight Dec 03 '12 at 11:26
  • @thedorkknight Glad you have found your solution. Why do you want the question closed? It could be useful to a future visitor. – mathematician1975 Dec 03 '12 at 11:35
  • by closed , i mean that just archive it. i dont mean delete it. it would definitely be useful for a future visitor. – thedorkknight Dec 03 '12 at 15:11