How to do tiledlayout for Boxplots?

Illustration
sunny02 - 2020-07-02T12:29:47+00:00
Question: How to do tiledlayout for Boxplots?

I am trying to do a tiledlayout for MATLAB boxplots. My code is:   tiledlayout('flow'); boxplot(randn(10,5)); nexttile; boxplot(randn(10,5)+5); nexttile; boxplot(randn(10,5)-6); nexttile; boxplot(randn(10,5)); But I always get the below warnings Warning: Unable to set 'Position', 'InnerPosition', 'OuterPosition', or 'ActivePositionProperty' for objects in a TiledChartLayout > In boxplot>renderLabels/setLabelappdata (line 3012) In boxplot>renderLabels (line 2913) In boxplot (line 407)

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

The boxplot function sets the position of axes (If the axes are not UI axes -> line 3012) and according to the warning, it can not be set for tiled layout. This might be the reason for the warning. If you do not want the warning to show up, you may use

 

warning('MATLAB:handle_graphics:Layout:NoPositionSetInTiledChartLayout','off')

And for all the plots to be shown, use nexttile before first plot. Refer this example.

tiledlayout('flow');
nexttile;
boxplot(randn(10,5));


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!