Adding contour lines to heatmap

Using a 100X100 matrix, I have genertated this heatmap (attached fig). The deepest shade of red indicates a frequency of 25. And deep blue indicates a frequency of 0.
How will I add a line (a circle) to show encircle the area covers 90% of my data?
I want to compare multiple such figures..so such contour lines will be very useful for me.
Thanks in advance!!

Respuestas (1)

KSSV
KSSV el 12 de Oct. de 2020

0 votos

Read about contourf.
Or use contour with hold on. You need to specify the level and your desired color.

4 comentarios

Ishani Mukherjee
Ishani Mukherjee el 12 de Oct. de 2020
Editada: Ishani Mukherjee el 12 de Oct. de 2020
Thank you so much!!.. this connects points with similar values..is there any way I can encircle all points above a certain value ?
I also want to keep the heatmap intact..just make contour lines on top of it..not convert it to a contour plot.
KSSV
KSSV el 12 de Oct. de 2020
Let X, Y, Z be your data matrices.
idx = Z<=1 ;
x = X(idx) ; y = Y(idx) ;
idxb = boundary(x,y) ;
pcolor(X,Y,Z)
shading interp
hold on
plot(x(idxb),y(idxb),'k')
Ishani Mukherjee
Ishani Mukherjee el 12 de Oct. de 2020
Thanks..
KSSV
KSSV el 13 de Oct. de 2020
Then what is 100*100 matrix in the question? How can you generate such plot without a matrix?

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 12 de Oct. de 2020

Comentada:

el 13 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by