# MATLAB: How to modify titles on plots generated by controlchart(y, ‘chart’, {‘i’,’mr’})

controlchartfigurehandlesi-mrMATLABplotsubplottitle

controlchart() uses subplot to generate two charts. After I generated the plots, I realized that I can only change the last subplot and not the first one.
How can I change the titles and x/ylabels of each subplot?
(I think it has something to do with figure handles, but I can't quite figure it, no pun intended.)

%%Example from documentation for generating a control chart objectload partsst = controlchart(runout,'chart',{'xbar' 'r'});%%Modify this chart to add your own titles%Get figure handlefigureHandle = gcf;%Inspect the contents of the figure children%Notice it contains two axes objects for each of the subplot and %one legend objectfigureHandle.Children%Now get hold of the axes handles for the subplotssubplotHandle1 = figureHandle.Children(1);subplotHandle2 = figureHandle.Children(3);%Finally set the 'String' property associated with the Title text object%inside the axes object, to your custom stringsubplotHandle1.Title.String = 'My title 1';subplotHandle2.Title.String = 'My title 2';