show a digit matrix with segmentation line

조회 수: 1 (최근 30일)
HG
HG 2021년 4월 30일
편집: HG 2021년 5월 18일
.

답변 (1개)

Benjamin Großmann
Benjamin Großmann 2021년 4월 30일
편집: Benjamin Großmann 2021년 4월 30일
matrix = [ 1 1 1 1 2 2 2 2;
1 1 1 2 2 2 2 2;
3 3 3 3 3 2 2 2;
3 3 3 3 3 3 3 3];
heatmap(matrix, 'Colormap', [1 0 0; 0 0 1; 0 1 0]) % <-- EDIT: colormap definition in heatmap function call changed
colorbar('off')
  댓글 수: 2
HG
HG 2021년 5월 4일
I want to show a matrix like this photo with black line boundaries.
how can I do this ?
Benjamin Großmann
Benjamin Großmann 2021년 5월 4일
You can use patch() with properties 'FaceColor' and 'EdgeColor' to plot colored surfaces with black line boundaries.

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

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by