Explanation

You cannot specify the location of the legend using an integer specifier. Instead, use 'Location' with a character vector specifier.


Suggested Action

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

'NorthEastOutside'

0

Inside axes

'Best'

1

Upper right corner of axes

'NorthEast'

2

Upper left corner of axes

'NorthWest'

3

Lower left corner of axes

'SouthWest'

4

Lower right corner of axes

'SouthEast'

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.