You cannot specify the location of the legend using an integer
specifier. Instead, use 'Location'
with a character
vector specifier.
Replace the integer-valued legend position with 'Location'
and a character vector value as indicated below.
Integer Specifier | Location in Axes | Character Vector Specifier |
---|---|---|
-1 | Outside axes on right side |
|
0 | Inside axes |
|
1 | Upper right corner of axes |
|
2 | Upper left corner of axes |
|
3 | Lower left corner of axes |
|
4 | Lower right corner of axes |
|
For example, to locate a legend in the lower left corner of the axes, use
'Location','SouthWest'
instead of the integer value
3
. The 'Location'
name-value pair
argument provides additional flexibility for the legend location beyond the six
options presented in the table. For more information, see legend
.