Creating a log probability plot for particle size distribution

I need to create a plot with the x axis scale shown here.(link) It seems to be similar to the scale used on the y axis of a Weibull plot however I cannot find any resources explaining how to use this scale on the x axis. for context I am doing a particle size distribution from a crystalliser.

 Accepted Answer

See the Statistics and Machine Learning Toolbox probplot function.

4 Comments

Thanks for the swift response, I have viewed that page however all the examples show data on the x axis and probability on the y axis whilst I need the probability to be on the x axis as shown in the link I provided. Is there a way to do this?
Rather than re-inventing everything, it is likely easiest to get the information from the original probplot and re-plot everything on the reversed axes —
x1 = wblrnd(3,3,[500,1]);
figure
probplot('weibull',x1)
grid
Ax1 = gca; % Get Information From Original'probplot'
L = findobj(Ax1, 'Type','line');
x = L(1).XData;
y = L(1).YData;
flx = L(2).XData;
fly = L(2).YData;
xtv = Ax1.XTick;
xtl = Ax1.XTickLabel;
ytv = Ax1.YTick;
ytl = Ax1.YTickLabel;
yal = Ax1.YLim;
xl = Ax1.XLabel.String;
yl = Ax1.YLabel.String;
tl = Ax1.Title.String;
figure
semilogy(y,x, '+b')
hold on
plot(fly, flx, '--k')
hold off
grid
xlabel(yl)
ylabel(xl)
title(tl)
Ax2 = gca; % Set Information On Rotated 'probplot'
Ax2.XTick = ytv;
Ax2.XTickLabel = ytl;
Ax2.XLim = yal;
Ax2.XTickLabelRotation = -90;
Ax2.YTick = xtv;
Ax2.YTickLabel = xtl;
It seems to work.
.
Thanks Star Strider, it seems you are very well versed on this topic. I found another thread you answered previously here. it turns out i wasnt explaining myself clearly and the linked thread is exactly my problem. Do you know a method to make the axis on a normal plot() function mimic that of a probability scale?
Working on this. I’m having problems getting the x-tick labels to plot correctly. The rest seems to be working. Back later.
EDIT — (4 Oct 2022 at 15:52)
This is as close as I can get, at least for the time being. There is obviously something I’m overlooking with respect to the x-axis scaling, since it’s not as I want it, and that affects how the tails are plotted. (The dashed reference line eludes me, and I am not comfortable with exploring the probplot code to see how it’s calculated.)
x1 = wblrnd(3,3,[500,1]); % Create Data
pd = fitdist(x1,'Weibull'); % Fit Distribution
yc = cdf(pd,x1); % Cumulative Distribution
[ycs,idxs] = sort(yc); % Sort For Plotting
x1s = x1(idxs);
pcv = linspace(1E-3, 100-1E-3, numel(x1)); % Vector Of Percentile Values
pc = prctile(x1,pcv); % Determine Data Percentiles
xaxt = [0.001 0.005 0.01 0.05 0.1 0.25 0.5 0.75 0.95 0.995]; % X-Axis Tick Values
xax = icdf(pd,xaxt(:)); % Corresponding Data Value Extimates, Based On 'pd'
xv = linspace(0, 1, numel(xax)); % Corresponding Axis X-Values
x1v = linspace(0, 1, numel(x1)); % Corresponding Axis X-Values
x1axt = interp1(pcv,pc,xaxt); % Interpolate Axis X-Values To Data X-Values
figure
semilogy(x1v, pc, '+')
% hold on
% plot(xv, xax, '--k')
% hold off
grid
Ax = gca;
set(Ax, 'XTick',xv, 'XTickLabel',xaxt)
Ax.XTickLabelRotation = -90;
xlim([0 1])
xlabel('Probability')
ylabel('Data')
.

Sign in to comment.

More Answers (1)

Using same example data as above ...
x1 = wblrnd(3,3,[500,1]);
figure
probplot('weibull',x1)
grid
set(gca,'XDir','reverse')
view([90 90])

1 Comment

Thanks Paul, any help is much appreciated. I found another thread answered previously here. it turns out i wasnt explaining myself clearly and the linked thread is exactly my problem. Do you know a method to make the axis on a normal plot() function mimic that of a probability scale?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!