MATLAB: How to make one colorbar for all subplots

colorbar subplots

Hi everybody
So I made a plot with four subplots (2×2). Now I would like to insert one (big) colorbar on the right Hand side of the four plots without changing the size of any of the plots. Somehow I only manage to make a bar for one subplot…
Cheers Ronny

Best Answer

I assume you’ve already discovered the colorbar function. See Axis Properties for a description of the properties you can set. The location property applies only to colorbars and legends, not to axes.