Search code examples
matlabmatlab-figure

Retrieve Gradient of Reference Line Generated by probplot


I am generating probability plots for a number of data sets in matlab. I am plotting them using probplot with a weibull distribution reference line

data = [1,1,1,1,2,2,2,3,4,5,3,3,2,2,1,3,5,7,2,4,2] ;
h = probplot('weibull',data) ;

This function as per the matlab documentation returns a graphic array object. This appears to only contain the original data and not the reference line.

Is there any way of retreiving information about about this reference line without plotting it and indiviually extracting it using the figure tools (very much not an option I'd like to go down as there are potentionally hundreds of plots to go through).

I can see there is wblplot that returns a line array of 3 lines, one of which is the original data and one of the others is likely the reference the line however I will have to try different distributions to fit further down the road and would prefer to keep a generic approach.


Solution

  • You are wrong!

    data = [1,1,1,1,2,2,2,3,4,5,3,3,2,2,1,3,5,7,2,4,2] ;
    h = probplot('weibull',data) ;
    
    b=h(2);
    figure
    plot(b.XData,b.YData)
    

    h is a graphic array object, so its an array. The first element contains the original data, but the second h(2) contains the reference line.