Method 1: Plot directly using semilogy
If you are generating a new 2D plot, use semilogy instead of the standard plot command:
x = 0:0.1:10;y = exp(x);
semilogy(x, y, 'b-', 'LineWidth', 1.5);xlabel('Linear X Axis');ylabel('Logarithmic Y Axis');grid on;
Method 2: Change an existing plot with YScale
If you already plotted your data using plot, scatter, or bar, modify the axes property directly without re-plotting:
% Dot notation (MATLAB R2014b and newer):ax = gca;ax.YScale = 'log';
% Classic syntax (works in all MATLAB versions):set(gca, 'YScale', 'log');
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: