create a plot with a figure number and title below it in matlab

main.m
% Create a plot
x = 1:10;
y = x.^2;
figure(1);
plot(x, y);

% Add figure number and title below it
str = ['Figure 1: Example Plot'];
annotation('textbox', [0, 0, 1, 0.05], 'String', str, 'EdgeColor', 'none', 'HorizontalAlignment', 'center');
242 chars
10 lines

related categories

gistlibby LogSnag