I am having a specific problem. Firstly I am using octave. I have a dataset where every row is of the following format:
datarow = [ x, y, z, colourIndex];
The length of the dataset is irrelevant, but suppose it is 10. I want to be able to plot the 3d plot with every point having a colour of its specific color index. Of course I know that I can use a for loop and add every point individually, but I find it hard to believe that there isn't already some way to do that using vectors.
So far I have tried:
map = cool(); #init colormap
data = initializeData(); #initialize data
plot3(data(:,1),data(:,2),data(:,3),"c" , map(data(:,4))); #doesn't work
Any ideas if it's possible to do a one-liner for my issue?
Use
scatter3
: