www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/AddTextToTheEndOfEachLabelExample.m

    %% Add Text to End of Each Label
% Create a bar chart. Display $^{\circ}\rm F$ after each tick value label
% along the _y_-axis by setting the |TickLabelFormat| property to 
% |'%g^\\circF'|.

temp = [37 39 46 56 67 77 82 80 73 62 52 42];
bar(temp)
ylabel('Average temperature')
xlim([0 13])

ax = gca;
ax.YAxis.TickLabelFormat = '%g^\\circF';