colormap as a function of value

1 visualización (últimos 30 días)
Alejandro Fernández
Alejandro Fernández el 22 de En. de 2020
Comentada: Alejandro Fernández el 22 de En. de 2020
Hello, I have a graph that I have made with countourf and I would like to make all the values that are higher than 10 all red, the values between 7 and 10 a gradient from yellow (7) to red (10), the values between 5 and 7 a gradient that goes from green (5) to yellow (7) and then those that go from 0 to 5 a gradient from blue (0) to green (5).
The values I put in brackets refer to the value of each color.

Respuesta aceptada

darova
darova el 22 de En. de 2020
Did you try to color lines separately?
contourf(x,y,z,10:15,'color','r')
cmap1 = jet(10);
hold on
for i = 7:10
contourf(x,y,z,[i i],'color',cmap1(i,:)) % gradient color for [7 10]
% maybe colormap adjustment will be needed
end
  1 comentario
Alejandro Fernández
Alejandro Fernández el 22 de En. de 2020
Is a very nice option and I hadn't realized on it.
Thank you so much

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by