% 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,:))))
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.