Use the full range of colours in a colourbar
7 次查看(过去 30 天)
显示 更早的评论
Hi everyone and thank you in advance for your time. I've a question related to colour bar use. I'm plotting several correlation matrices using Heatmap. The values technically range from 1 to -1 although it depends on the matrix I'm plotting. Some could be from 1 to -0,1 never reaching very negative values). I choose the preferred colourbar (jet). Based on what I understand, when I'm plotting these matrices separatelly Matlab should take the min value of my matrix and assign it to the deep blue end of the bar and then do the equivalent for the max value assigning it to the deep red, then all the other values will fall somewhere in between. This in not what is happening though. It seems that the colour on my heatmap correspond to a fixed range (-1 for deep blue and 1 for deep red). This is useful when comparing between the different heatmaps but I would like to set the range of colour for every heatmap when I'm plotting them individually and display it next to my heat meatrix.
Thank you again.
Antonis
6 个评论
Walter Roberson
2018-5-7
Sorry, I need to get to sleep, this is too big of an investigation for the energy I have left at the moment.
采纳的回答
Arthur Goldsipe
2018-5-7
You are using the HeatMap function from the Bioinformatics Toolbox. By default, this function uses a symmetric colormap. In the case of your data, you would only see blue colors if you also had negative values near -1. If you don't want this symmetric coloring, set the Symmetric option to false. For example, try the following code: HeatMap(linspace(-0.1,1),'ColorMap','jet','Symmetric',false)
更多回答(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!