%% Change Exponent Value for y-Axis Tick Labels
% This example shows how to change the value displayed in the exponent label at the top of the y-axis.
% Plot data with y values that range between -15,000 and 15,000. By default, the y-axis tick labels use exponential notation with an exponent value of 4 and a base of 10.

x = linspace(0,5,1000);
y = 100*exp(x).*sin(20*x);
plot(x,y)

%
% Change the exponent value to 2. Set the Exponent property of the numeric ruler associated with the y-axis. Access the numeric ruler through the YAxis property of the axes object. The exponent label and the tick labels change accordingly.

ax = gca;
ax.YAxis.Exponent = 2;

%
% Change the exponent value to 0 so that the tick labels do not use exponential notation.

ax.YAxis.Exponent = 0;

%
% Change the exponent back to the default value by setting the associated mode property back to automatic.

ax.YAxis.ExponentMode = 'auto';

% Copyright 2012 The MathWorks, Inc.