How to click into the heatmap created inside a UI panel?

조회 수: 4 (최근 30일)
Yiling
Yiling 2025년 1월 29일
댓글: Adam Danz 2025년 1월 31일
I’m working on building an interactive Heatmap in Matlab UI. I've added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. When I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks!
  댓글 수: 3
Yiling
Yiling 2025년 1월 31일
Hi Adam, what you sensed is correct! I've actually resolved this by applying a windowbuttondownfcn on the UI figure so that I can click on the heatmap within a ui panel on the ui figure. My current issue is, when the heatmap becomes bigger and bigger, it just scales itself to fit into the panel. What I want is that the heatmap won't change its column and row width, so when there are more rows, the panel will have a scoller that I can drag down. Now it looks like the heatmap label is sticking its position to the bottom and left edge of the ui panel.
Is there a solution you can think about? Does imagesc (which create image instead of a plot) better help with this?
Adam Danz
Adam Danz 2025년 1월 31일
imagesc is a common alternative to heatmap. However, imagesc lacks many features in heatmap such as interactively sorting columns and labels, categorical zoom that snaps to edges, and the automatic labeling of cells.
Here's a demo on using imagesc to imitate heatmap

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

답변 (0개)

카테고리

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

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by