Combining Tiled Chart Layouts
56 views (last 30 days)
May_the_degrees_of_freedom_be_with_you on 20 Sep 2021
I am trying to combine 6 line graphs into 1 page. The tiled chart layout function appears perfect for this, but I need separate parent titles for each set of 3 figures. Since sgtitle() operates on the entire layout, it seems like the best method is to create two tiled chart layouts--one 1 X 3 layout for each set of 3 figures. That way, I can create a third tiled chart layout (2 X 1) to stack the two parent figures one on top of the other. This should let me have titles for each figure, titles for each set of three figures, and then a shared legend at the bottom of the page that describes all six figures.
I have successfully created the two 1 X 3 layouts, but I cannot merge them. For example,
Final = tiledlayout(2,1);
Returns an empty figure. If, instead of openfig(), I use the handle for the existing layouts, it returns "handle to deleted TiledChartLayout".
Thank you in advance. I have been buried in the documentation for hours before asking the community.
Harikrishnan Balachandran Nair on 23 Sep 2021
I understand that you are trying to have a seperate title for each row in your 'tiledlayout'.
Tiledlayout creates a tiled chart layout for displaying multiple plots(Axes) in the current figure or specified parent container. In the code you have provided, you are trying to have two figures inside a figure, which is not possible.
In this case, since you are trying to have two tiledlayouts with seperate titles, each of dimension (1,3), you can have two 'panels' defined in the same figure, and have a tiledlayout of dimension 1*3 in each uipanel. You may adjust the position property of the 'uipanel' to achieve the same. The following code might help.
You can also have required text boxes in your 'figure' using the 'annotation' function , by setting the 'shapetype' as 'textbox' and changing the 'dim' value to fit to the required position. You may refer to the documentations to get a better idea on setting the properties of the corresponding objects.
You may also refer to a similar question here : https://www.mathworks.com/matlabcentral/answers/736147-add-titles-over-rows-in-subplots