Use the full range of colours in a colourbar

4 ビュー (過去 30 日間)
Antonis Asiminas
Antonis Asiminas 2018 年 5 月 7 日
コメント済み: Antonis Asiminas 2018 年 5 月 7 日
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
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.
Antonis Asiminas
Antonis Asiminas 2018 年 5 月 7 日
No worries! Thank you for your time!

サインインしてコメントする。

採用された回答

Arthur Goldsipe
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)
  2 件のコメント
Antonis Asiminas
Antonis Asiminas 2018 年 5 月 7 日
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 2018 年 5 月 7 日
It turns out that just by stating ...'Symmetric',false) i get what I need. Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by