Do you mean in an export or as displayed in the figure window?
- For the export, if you use the newer exportgraphics instead of print, it'll just do this. This is maybe the best thing about exportgraphics compared to print/saveas!
- For the figure window, you can get rid of most of the whitespace by using tiledlayout and nexttile (with a 1x1 layout) setting the Padding property to tight. It doesn't get rid of all of the whitespace but the majority of it.
Here's what I get with your code and: exportgraphics(gcf,'foo.png'). This is with your position set and default dpi, so it's low res. If you select it you'll see the image boundary runs tightly alongside the colorbar label.
And here's tiledlayout/nexttile
t=tiledlayout(1,1,'Padding','tight');
x1 = linspace(0,T,1000)';
c.Label.String = 'Density (normalised)';
ax.FontName = 'Garamond';
set(gcf,'units','centimeters','position',[10 10 6.93 6.93/2])
annotation('rectangle','Position',[0 0 1 1],'LineWidth',2)