show a digit matrix with segmentation line

3 visualizaciones (últimos 30 días)
HG
HG el 30 de Abr. de 2021
Editada: HG el 18 de Mayo de 2021
.

Respuestas (1)

Benjamin Großmann
Benjamin Großmann el 30 de Abr. de 2021
Editada: Benjamin Großmann el 30 de Abr. de 2021
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 comentarios
HG
HG el 4 de Mayo de 2021
I want to show a matrix like this photo with black line boundaries.
how can I do this ?
Benjamin Großmann
Benjamin Großmann el 4 de Mayo de 2021
You can use patch() with properties 'FaceColor' and 'EdgeColor' to plot colored surfaces with black line boundaries.

Iniciar sesión para comentar.

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by