Colorbar with diamond-shape blocks
Show older comments
Hello,
I want to plot a colorbar with customized shapes. When I execute the colorbar command, I get the following colorbar in which each block is rectangular-shaped.
However, I want to plot the colorbar in which each block has a diamond shape as shown in the following eample:

Is it possible to customize the shape of the grid boxes like this?
Any help will be greatly appreciated.
Regards,
AG
2 Comments
Rik
on 24 Jan 2020
Colorbars used to be axes objects. You can take that as an inspiration and create your own replacement for the colorbar that uses a separate axes object and a bunch of calls to patch.
As far as I'm aware (especially in the more modern releases) it is not possible to achieve what you want with a colorbar object.
Spencer Chen
on 24 Jan 2020
I don't think you get that with vanilla Matlab. One way is to create your own colorbar axes and plot 'd' diamond markers.
Blessings,
Spencer
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
