Problem with semilogx plot
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
NGUYEN Quang Hung
am 13 Jun. 2014
Kommentiert: Star Strider
am 13 Jun. 2014
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
0 Kommentare
Akzeptierte Antwort
Star Strider
am 13 Jun. 2014
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:
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Log Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!