Assigning a different colors to NaN while plotting heatmap.

19 vues (au cours des 30 derniers jours)
Vikash Mittal
Vikash Mittal le 22 Juin 2020
Commenté : Adam Danz le 23 Juin 2020
Hello all
I have a data, let's say 1000X1000 which consists of numerical values and NaN.
I have to generate a heatmap from it for which I am using the inbuilt command in MATLAB. At the same time, I want to assign a different color(different from my spectrum) to all NaN's. According to the documentation (https://in.mathworks.com/help/matlab/ref/matlab.graphics.chart.heatmapchart-properties.html) we can use
h = heatmap(__,'MissingDataColor',[0.8 0.8 0.8])
to achieve the goal but it is not working in my case.
Please help.
  5 commentaires
Vikash Mittal
Vikash Mittal le 23 Juin 2020
I was using 2020a and as I said before it was working but not changing the color. There was no error message.
Actually I figured out the reason. There is one package I found https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/24253/versions/7/previews/html/heatmap_examples.html here which I put in my path. This was creating the problem. Although, I don't understand what is the difference between the command given in package and the conventional MATLAB command for heatmap.
Adam Danz
Adam Danz le 23 Juin 2020
I had a feeling you were shadowing the main function.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by