How can I represent a map with different with color value

2 次查看(过去 30 天)
I have 4 array, in which first one is depth value, 2nd one is classification, and the last three columns are color value. I want to plot the classification with depth using this color value.
Z=[A B C]
A=[0.5 1 1.5 2.0 2.5 3];
B=[class1 class1 class2 class2 class1 class1]
C = [ 0.711991 0.987599 0.012401, 0.711991 0.987599 0.012401, 0.800533 0.565409 0.434591, 0.800533 0.565409 0.434591, 0.711991 0.987599 0.012401, 0.711991 0.987599 0.012401]
That means class1 will be represented by color value 0.711991 0.987599 0.012401 and class2 will represented by color value 0.800533 0.565409 0.434591. These classes want to plot with depth. Mainly, depth will be plotted against this color value which represents the various classification.

回答(1 个)

KSSV
KSSV 2019-4-16
Read about plot.....it takes input (x,y) and color vector 1*3.
figure
hold on
for i = 1:10
x = rand ;
y = rand ;
col = rand(1,3) ;
plot(x,y,'.','color',col,'MarkerSize',50)
end

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by