Below is a part of my code.
[leg, hobj1] = legend('MFR1', 'MFR2', 'MFR3', 'MFR4', 'MFR5', 'Reference') ;
textobj = findobj(hobj1, 'type', 'text');
set(textobj, 'Interpreter', 'latex', 'fontsize', 12);
legend(leg, "location", "northeast");
The code works perfectly fine. Now I change the last row with location from "northeast" to "northwest":
legend(leg, "location", "northwest");
Problem: Although the legend moves to the location desired, the properties of the legend do not change. i.e., the font size does not change, the text Reference goes outside the box. This happens for all the locations except northeast.
For me, the latex interpreter is not really necessary, I used it to solve my main problem of the legend box either going outside my plot or the text inside the box extending outside the box.
Can someone please help me with this?
Thank you