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

    %% Modify x-Axis Label After Creation
% Label the _x_-axis and return the text object used as the label.   

% Copyright 2015 The MathWorks, Inc.


plot((1:10).^2)
t = xlabel('Population');
%% 
% Use |t| to set text properties of the label after it has been created.
% For example, set the color of the label to red. Starting in R2014b, you
% can use dot notation to set properties. If you are using an earlier
% release, use the <docid:matlab_ref.f67-432995> function instead.

t.Color = 'red';