Problem with semilogx plot
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
NGUYEN Quang Hung
el 13 de Jun. de 2014
Comentada: Star Strider
el 13 de Jun. de 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 comentarios
Respuesta aceptada
Star Strider
el 13 de Jun. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Log Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!