Colorbar - change color of a specific value

10 visualizaciones (últimos 30 días)
mael thevenot
mael thevenot el 19 de Mzo. de 2018
Editada: mael thevenot el 20 de Mzo. de 2018
Hi,
I am displaying a map of temperature using contourf and a colorbar (see below). All low temperatures that are not exact are set to Nan and i've set the background to black. The max temperature is not exact either because my sensor is saturated. So I would like to display saturated temperature to another color (like white for example), without having it displayed on the colorbar.
I've isolated max values of spots in an array, but how can I say that all my pixels equal to this value = a specific color? And is it possible not to have this color on the colorbar?
b=figure;
contourf(heure_num, distance, spots, 100,'LineColor', 'none');
c = colorbar;
set(gca, 'fontsize', 14);
set(gca, 'ydir', 'reverse');
set(gca,'Color','k');
ylim([0 max(max(distance))]);
Thanks for helping me and sorry for my english.
EDIT : while I was searching I run into this :
cm = colormap;
cm(1, :) = [1 1 1];
colormap(cm);
This seems to turn the lower values of the colormap into black? How do I do that for the max value and in white please?

Respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by