Is it possible to convert the font of a matlab plot to be the same of latex fonts. For example I can modify the font of a plot by:
x = -pi:.1:pi; y = sin(x); plot(x,y) set(gca,'FontName','Helvetica');
Is it possible to do the same but for latex fonts (I say latex fonts as I am not sure of the actual name of the font latex uses as its basic font).
However, linux's command fc-list lists all fonts on your system, I think they are all supported by Matlab. In ubuntu (and possibly other distro's) the latex font is called Latin Modern, or lm for short. You can find them all via: # fc-list | grep lmroman /usr/share/texmf/fonts/opentype/public/lm/lmroman10-bold.
MATLAB supports most standard LaTeX math mode commands. These tables show a list of supported LaTeX commands.
On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts and, in the Desktop code font section, select a font name and style.
For any text object you just need to set the 'Interpreter' property to 'latex'. So, for example you could do
xlabel('$$\int_0^x\!\int_y dF(u,v)$$','Interpreter','latex');
For tick labels it is more difficult, though there may be files available to make it easier (example).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With