Editing colors in a colormap
3 次查看(过去 30 天)
显示 更早的评论
In my code, I'm using the imagesc function to create a changing colormap as a movie. I have created a manual map that goes from the white to black scale. However, there are certain parts of the colormap that I would like to manually make a color that does not fall in the white to black range, such as blue. I need to do this within my code, so that the code can capture the image as a frame. How would I accomplish this?
Thank you.
0 个评论
回答(1 个)
Adam
2019-1-28
How do you have your colourmap currently? If you have it as an e.g. 256x3 matrix of colours then you can just set e.g.
myColourmap( 100,: ) = [0 0 1];
to make the 100th index colour blue.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!