I am trying to include a legend in my Matlab graph that uses the Latex interpreter for the legend text.
When I set up a legend to use the Latex interpreter, the text inside overflows outside the legend field.
I tried to adjust the text size, but this happens regardless of FontSize.
Below is the relevant part 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 assume this is because Matlab does not account for the correct character size after the text has been interpreted using Latex. However, I do not know how to fix it.
Any insight would be greatly appreciated! Thanks!
matlab plot latex matlab-figure
tuntun
source share