Setting Zero to a specific color in 3D surface plot
Ältere Kommentare anzeigen
I am trying to set the color scale for my data, which blue for the positive, red for the negative, and setting zero as grey color.
I had been using the code now, which seperate the positive and negetive, but not the zero yet.
%data here means the data I imported from the excel sheet.
y = data(2:end,1) ;
x = data(1,2:end) ;
Z = data(2:end,2:end) ;
surf(x,y,Z)
colormap(hot(2))
shading interp
caxis([-15 15])
I tried to remove the zero by setting zero as NaN, but this affects the result as "interp" is used.
Is it posible to set the zero as as specifc color with this condition?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
