You cannot place a rectangle in the background using 'insert' -> 'rectangle'.
Instead, create the rectangle in the command window / script and just add shapes/lines as desired, adding the object you want on top last. For example:
>> figure1 = figure;
>> axes1 = axes('Parent', figure1);
>> hold(axes1,'on');
>> rectangle('Parent',axes1,'Position',[3 3 3 3],'FaceColor',[1 0 0]);
>> plot(1:10);
'Insert' -> 'rectangle' actually creates an annotation in the shape of a rectangle, rather than just a rectangle.
Best Answer