I have a plot in MATLAB that I would like to transform into a colormap (plot shown below). There are several line segments in this plot, and I want each line segment to be colored based on a specific value that is associated with the segment.
For example:
Value of line 1 = 800, plot a specific color
Value of line 2 = 555, plot a specific color ...etc.
Does anyone know how to do this? I have included the part of the code in my program that is making the plots below. In the code I want the color of the line to be dependent on ElementMap(i,6). I don't have a particular preference on the colors as long as I can tell which line segments have a higher value.
Thanks
%% Plot
for i = 1:length(ElementMap)
if ElementMap(i,6) < 1000
x = [ElementMap(i,1);ElementMap(i,3)];
y = [ElementMap(i,2);ElementMap(i,4)];
plot(x,y,['-','b','o']);
hold on;
end
end
