Borrar filtros
Borrar filtros

Use the full range of colours in a colourbar

7 visualizaciones (últimos 30 días)
Antonis Asiminas
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
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.
Antonis Asiminas
Antonis Asiminas el 7 de Mayo de 2018
No worries! Thank you for your time!

Iniciar sesión para comentar.

Respuesta aceptada

Arthur Goldsipe
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
Antonis Asiminas
Antonis Asiminas el 7 de Mayo de 2018
Thank you for this. I understand that HeatMap is not the ideal function for what I want to do. Just one question here; where do I state my input matrix in this code? Cheers, A
Antonis Asiminas
Antonis Asiminas el 7 de Mayo de 2018
It turns out that just by stating ...'Symmetric',false) i get what I need. Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by