I know someone uses the text function but I am ont able to solve my problem. This is my code:
label = categorical({'A';'B';'C';'D';'E'});risks = [-1,2;-1.5,1;-5,2.5;-5,NaN;-3.2,NaN;];temp = abs(risks);lim_g = max(max(temp));h = barh(label,risks,'grouped');set(h(1),'FaceColor',[0.753 0 0])set(h(2),'FaceColor','g')xlim([-lim_g-1 lim_g+1])a=[cellstr(num2str(get(gca,'xtick')'))]; pct = char(ones(size(a,1),1)*'%'); new_yticks = [char(a),pct];set(gca,'xticklabel',new_yticks)
I would like to put the value on the end of each bar. Can Someone help me? Many thanks!!!!
Best Answer