MATLAB: Problem with semilogx plot

psdsemilogx

I have a Particle-size distribution of a powder like this image:
from the raw data in the excel sheet , I have imported into the matlab an run the following code:
clc
clear all
close all
irl= xlsread('granulo','irl');
dia_irl= irl(:,1); cum_irl= irl(:,2);
figure;
hold all;
semilogx(dia_irl, cum_irl);
xlabel('Diamètre, \mum');
ylabel('Cumulative value');
But I can get the graph like the above, how can I do?
Best regard

Best Answer

This is not exactly the same as your example plot, probably because your data are not the same, but it is close:
irl = xlsread('granulo','irl');
dia_irl = irl(:,1);
cum_irl = irl(:,2);
hst_irl = irl(:,3); % Histogram data for bar plot‘’
figure(1)
plot(log10(dia_irl), cum_irl, '-r') % Plot of ‘cum_irl’ on log10 of ‘dia_irl’
hold on
bar(log10(dia_irl), hst_irl) % Bar of ‘hst_irl’ on log10 of ‘dia_irl’
hold off
grid
logxts = [-2:2 log10(500.1)]; % Desired log10 'XTick'
set(gca, 'XTick', logxts) % Set new 'XTick' locations
expxts = 10.^(logxts); % Take antilog to use them as new ‘XTickLabels’
set(gca, 'XTickLabel', floor(1*expxts)/1) % Format labels
axis([min(logxts) max(logxts) 0 100])
The plot: