legend('sin(x)','cos(x)','Location','North');
Matlab位置选择
| 设置 | 位置 |
|---|---|
| 'North' | inside plot box near top |
| 'South' | inside bottom |
| 'East' | inside right |
| 'West' | inside left |
| 'NorthEast' | inside top right (default for 2-D plots) |
| 'NorthWest' | inside top left |
| 'SouthEast' | inside bottom right |
| 'SouthWest' | inside bottom left |
| 'NorthOutside' | outside plot box near top |
| 'SouthOutside' | outside bottom |
| 'EastOutside' | outside right |
| 'WestOutside' | outside left |
| 'NorthEastOutside' | outside top right (default for 3-D plots) |
| 'NorthWestOutside' | outside top left |
| 'SouthEastOutside' | outside bottom right |
| 'SouthWestOutside' | outside bottom left |
| 'Best' | least conflict with data in plot |
| 'BestOutside' | least unused space outside plot |
https://www.cnblogs.com/xym4869/p/12243271.html
