When using the following code, the colorbar overlaps with the tick labels of the x-axis:
surf(peaks);set(gca,'FontSize',28);cb = colorbar;
I already tried to modify the x-position of the colorbar with:
pos = get(cb,'Position');set(cb,'Position',pos + [0.05,0,0,0]);
This was unsuccessful since the whole axis is rescaled and even manually entering the retrieved original position values does not result in the original colorbar position. How can I move the colorbar to not overlap with the tick labels anymore?
Edit: The provided sample code is a simplified example and the increased fontsize is necessary for readability in my original code. My attempt to solve the problem was aimed at moving the colorbar further to the east.
Best Answer