Weibull distribution plot x-axes scale is wrong
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am having problems with plotting a Weibull distribution for the variable: 'Cont_Wh_Wp'.
The x-axes shows weird scale, see figure below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/774268/image.jpeg)
If I plot a histogram and and divide the x-axes by the number of point(662) the frequency on the x-axis seems to be better, see figure below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/774273/image.jpeg)
The schape of both graphs are the same, but the x-axes is different. Below is my script where I plot the two grapgh.
%% Weibull
[parmHat, parmCI]=wblfit(Cont_Wh_Wp);
scale= parmHat(1);
shape=parmHat(2);
figure(1)
X=linspace(min(Cont_Wh_Wp),max(Cont_Wh_Wp));
plot(X,wblpdf(X,parmHat(1),parmHat(2)))
%% Histogram
figure(2)
histogram(Cont_Wh_Wp,80)
Can someone help me with getting the x-axis on the right scale for the Weibull plot?
0 Commenti
Risposte (1)
Star Strider
il 21 Ott 2021
Try something like this —
%% Weibull
[parmHat, parmCI]=wblfit(Cont_Wh_Wp);
scale= parmHat(1);
shape=parmHat(2);
figure(1)
X=linspace(min(Cont_Wh_Wp),max(Cont_Wh_Wp));
plot(X,wblpdf(X,parmHat(1),parmHat(2)))
xl = xlim; % Get X-Axis Limits (Range)
%% Histogram
figure(2)
histogram(Cont_Wh_Wp,80)
xlim(xl) % Set X-Axis Limits (Range) To The First Plot Values
.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!