How to add std to heatmap cell?

I need to add std to the heatmap so that instead of showing 68.64 in the below heatmap, it shows 68.64 plus or minus STD.

7 comentarios

like what
68.46 ± 0.2
or any of the below value
68.64
68.26
Adam Danz
Adam Danz el 1 de Jun. de 2020
In heatmap plots, cells contain scalar numeric values. To show two values or to show a value +/- value, you would need to replace the numeric scalars with strings or character arrays or numeric vectors. That isn't possible.
The best you can do is to
  1. Overlay a 2nd axes (see this answer for a demo)
  2. Use the text() function to write the std to each cell.
I would offer a demo in the answers section but you don't accept answers very frequently which is a demotivator.
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 1 de Jun. de 2020
Thanks Adam I would try your solutions. I am surprised how you came to the conclusion that I dont accept answers very frequently. I suggest you check the questions I asked and number of "accepted answers".
Adam Danz
Adam Danz el 2 de Jun. de 2020
Editada: Adam Danz el 2 de Jun. de 2020
162 answered, 83 accepted. That's 51% which isn't too bad.
I'd be happy to help if you get stuck implementing my suggestion or any other solutions to the problem.
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 2 de Jun. de 2020
Some of the answers were not really answer to what I was was asked. Thank for the help.
Adam Danz
Adam Danz el 5 de En. de 2022
VIDHYA GANESAN's answer moved here as a comment.
============================================
Hi,
Did you get answer for your question?
I have a similar problem where in I need to plot heatmap with its standard deviation.
I tried to create another axis to overlay on the heatmap. But it did not work fine.
Could you please share how you resolved this query?
Thanks
Vidhya
Adam Danz
Adam Danz el 5 de En. de 2022
@VIDHYA GANESAN, heatmaps are difficult to customize. One alternative is to use imagesc instead. Here's a demo showing how achieve that and how to change the labels.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 1 de Jun. de 2020

Comentada:

el 5 de En. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by