MATLAB代码如下:
clc
close
clear
a =[ 34 2023
35 2022
36 2021
29 2020
24 2019
14 2018
9 2017
11 2016
7 2015
10 2014
10 2013
6 2012
4 2011
3 2010
3 2009
2 2008];
b=bar(a(:,2),a(:,1));
grid on
set(gcf,’color’,[1 1 1]);
set(gca,’FontName’,’Times New Roman’,’FontSize’,18);
xtips2 = b(1).XEndPoints;
ytips2 = b(1).YEndPoints;
labels2 = string(b(1).YData);
text(xtips2,ytips2,labels2,’HorizontalAlignment’,’center’,…
‘VerticalAlignment’,’bottom’,’FontName’,’Times New Roman’,’FontSize’,18);