Opening the book…
When plot values cover more than 1 order of magnitude, it can be more useful to create a logarithm plot rather than a standard lineat plot.
The MATLAB and Octave functions for logarithm plots are semilogx(), semilogy(), and loglog(). The following examples illustrate the use of these functions.
semilogy(), log(), semilogx()
% Log plot examples
% Create data
x = 0:5
y = 2*3.^x
%% Standard linear plot
figure;
plot(x,y,'-s')
title('Standard linear plot of y = 2*3.^x')
grid on
%% semilogy plot
figure;
semilogy(x,y,'-s')
title('semilogy plot of y = 2*3.^x')
grid on
%% semilogx plot
figure;
semilogx(x,y,'-s')
title('semilogx plot of y = 2*3.^x')
grid on
%% loglog plot
figure;
loglog(x,y,'-s')
title('semilogy plot of y = 2*3.^x')
grid on
Solution
![]() |
![]() |
![]() |
![]() |
Add example text here.
.
This page titled 14.4: Log plots was last modified on Sun, 04 Aug 2024 21:01:54 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Carey Smith.
The book could not be loaded just now.



