필터 지우기
필터 지우기

How not to display zero entries in heatmap?

조회 수: 6 (최근 30일)
Vidura Vishvanath
Vidura Vishvanath 2022년 4월 15일
댓글: Vidura Vishvanath 2022년 4월 15일
I have generated following heatmap
Is it possible to make cells with zero entries just to display the colour without the value?
rawdata = readmatrix('Wave data_Galle_NARA.xlsx');
Hs_edges = 0.5:0.5:4.5;
Tp_edges = 5:1:22;
[N,Xedges,Yedges,binX,binY] = histcounts2(rawdata(:,2),rawdata(:,1),Tp_edges,Hs_edges,'Normalization','probability');
h = heatmap(N')
Thank you!
  댓글 수: 2
AndresVar
AndresVar 2022년 4월 15일
i don't think it's possible. But what about using the missing property
clear;
close all;
rawdata = readmatrix('Wave data_Galle_NARA.xlsx');
Hs_edges = 0.5:0.5:4.5;
Tp_edges = 5:1:22;
[N,Xedges,Yedges,binX,binY] = histcounts2(rawdata(:,2),rawdata(:,1),Tp_edges,Hs_edges,'Normalization','probability');
N(N==0) = nan;
h = heatmap(N(1:5,1:5)',MissingDataLabel='no data',MissingDataColor=[1 0.9 0.9]);
Vidura Vishvanath
Vidura Vishvanath 2022년 4월 15일
Thank you, This will do!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by