Creating a log probability plot for particle size distribution

14 views (last 30 days)
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

Star Strider
Star Strider on 4 Oct 2022
See the Statistics and Machine Learning Toolbox probplot function.
  4 Comments
Star Strider
Star Strider on 4 Oct 2022
Edited: Star Strider on 4 Oct 2022
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)

Paul
Paul on 4 Oct 2022
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
Sam Jones
Sam Jones on 4 Oct 2022
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!