How to add degree symbol to matlab plot

overall - matlab title subplot

This concerns your question:

To get a single legend entry for multiple items drawn separately (the more precise term would be "children of"), you should. This way, plotted objects (e.g. lines) are grouped together (technically they become children of the rather than directly the) so that you can apply certain settings to the whole group at the same time.

Here is a simple example of how this works:

Results in:

Whereas:

Where is:

Results in:

This example adds all of the lines drawn inside the loop to a single one without affecting previously drawn elements, and of course you can add other logic to group diagrams.

Note that a dynamic Legend usually adds any one in the diagram (if you draw a zoom box in an axis with a dynamic legend, the boundaries of the will be temporarily added to the legend!), But prevents this.