% The data. Each first row has years, each second row the counts that year.
xy = [];
xy = [xy [1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
% These control the size and aspect ratio of the output. size_inch (how big it
% is in the saved file) and width_pixel (how big it appears on-screen) are both
% large to reduce pixelation.
size_inch = [13 5]; % size of saved figure, inches
width_pixel = 1900; % temporary figure width, pixels
% Plot data. Adjust X-axis limits to fit the years in xy plus one on either end.
plot(xy(1,:), xy(2,:), 'LineWidth', 1.5)
set(gca, 'XLim', [min(xy(1,:))-1, max(xy(1,:))+1]) % -1 & +1 add some space
set(gca, 'FontName', 'Helvetica', 'FontSize', 12) % set tick mark font
% Save it as a PNG file with a size and aspect ratio of size_inch.
set(gcf, 'Units', 'pixel', 'Position', [1 1 width_pixel*[1 size_inch(2)/size_inch(1)]])
set(gcf, 'PaperUnits', 'inch', 'PaperPosition', [0 0 size_inch]);
saveas(gcf, sprintf('exec_per_year_%d_%d.png', min(xy(1,:)), max(xy(1,:))))