MATLAB Answers

How to remove colorbar and heatmap black borders?

584 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:
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!