I am trying to include a legend within my matlab plot which uses the Latex interpreter for the legend text.
When I set the legend to use the Latex interpreter though, the text within overflows outside the legend box.
I have tried adjusting the size of the text, but this occurs regardless of the FontSize.
The following is the relevant portion of my script:
I = legend([h1 h2 h3],'RainFall Flux', ...
'Temperature term ($$\rho \alpha$$dT)', ...
'Salinity term ($$\rho \beta$$dS)');
c=get(I,'children');
set(c(5),'LineWidth',3); %adjust lineWidth in legend
set(c(2),'LineWidth',3); %adjust lineWidth in legend
set(I,'interpreter','latex'); %set Latex interpreter
set(I,'FontSize',15);
I am assuming this is because matlab is not taking into account the proper character size after the text has been interpreted using Latex. However, I don't know how to fix this.
Any insight would be much appreciated! Thanks!