Detailed explanation of legend annotation function in Matlab