How do I control/view colorbar axis width?

9 views (last 30 days)
Michael on 2 Jan 2019
Commented: Michael on 2 Jan 2019
I need to know how to read the width of a colorbar including its axis labels. I am trying to configure the position of my colorbar to a specific location in my figure window and I need to offset other figure position properties based on the width of the colorbar and its labels so that they don't overlap.
Elsewhere in my figure generation script, I have successfully used h.Position, h.Outerposition, and h.TightInset to read and configure the location of the subplots in my figure window. The colorbar has a position property (h_cbar.Position) but this appears to be similar to the figure axis Position property - i.e. it does not include the axes. I need the TightInset equivalent for a colorbar to know the width of the colorbar tick labels and axes label. The attached image shows that I am looking for.
Thanks in advance.

Answers (1)

madhan ravi
madhan ravi on 2 Jan 2019
  1 Comment
Michael on 2 Jan 2019
Thanks, but that is that width of the line around the colorbar. That isn't the width of the entire colorbar element.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by