Use the full range of colours in a colourbar
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Antonis Asiminas
el 7 de Mayo de 2018
Comentada: Antonis Asiminas
el 7 de Mayo de 2018
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 comentarios
Walter Roberson
el 7 de Mayo de 2018
Sorry, I need to get to sleep, this is too big of an investigation for the energy I have left at the moment.
Respuesta aceptada
Arthur Goldsipe
el 7 de Mayo de 2018
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)
2 comentarios
Más respuestas (0)
Ver también
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!