MATLAB Answers

How to remove colorbar and heatmap black borders?

172 views (last 30 days)
I need to remove colorabar and heatmap blck borders. Any idea?

Accepted Answer

Benjamin Kraus
Benjamin Kraus on 2 Dec 2020
Edited: Benjamin Kraus on 2 Dec 2020
If you want to remove the colorbar, you can set the ColorbarVisible property to 'off':
h = heatmap(magic(5));
h.ColorbarVisible = 'off';
Alternatively, use the colorbar command:
heatmap(magic(5))
colorbar off
Heatmap does not provide any control over the borders around each cell, so if you want to remove the borders, you will have to switch to a lower-level function like image or surface.
  2 Comments
Benjamin Kraus
Benjamin Kraus on 12 Jul 2021
Heatmap does not provide any control over the tick labels on the colorbar. If you want control over those labels, you will have to switch to a lower-level function like imagesc or surface.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!