Hi Sasan,
Custom location and size, specified as a four-element vector of the form [left bottom width height]. The first two values, left and bottom, specify the distance from the lower left corner of the figure to the lower left corner of the legend. The last two values, width andheight, specify the legend dimensions. The Units property determines the position units.
If you specify the Position property, then MATLAB® automatically changes the Location property to 'none'.
example: legend({'A','B'},'Position',[0.2 0.6 0.1 0.2]);
You can change the width to more to make it appear to full length as shown in figure attached by you.
Hope this helps.
Thanks.