How can I change only one color in my colormap?
3 次查看(过去 30 天)
显示 更早的评论
I plot a 3dimensional temperature distribution via interpn in the whole space. so the data that are not defined by my input data appear as zero. to put them as NaN does not work for the programm to run. So i want to change the color for c=0 to white so it doesnt disturb the view. how can I do that?
0 个评论
采纳的回答
Image Analyst
2015-6-11
Assuming the 0 value is the first row of your color map:
yourColorMap(1, :) = [1,1,1];
3 个评论
Image Analyst
2015-6-11
Yes.
yourColorMap = jet(256);
yourColorMap(1, :) = [1,1,1];
colormap(yourColorMap);
colorbar;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!