Latex fonts in matlab

后端 未结 7 914
执念已碎
执念已碎 2020-12-24 08:19

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);         


        
7条回答
  •  醉梦人生
    2020-12-24 09:08

    You can define the font within the latex strings. For instance, to change between serif font (Roman) and sans serif font (Helvetica, I guess):

    text(0.5, 0.8, '\textsf{sans serif}','interpreter','latex')
    text(0.5, 0.7, '\textrm{roman}','interpreter','latex')
    text(0.5, 0.6, '$$\mathsf{math\,\,mode\,\,sans\,\,serif}$$','interpreter','latex')
    text(0.5, 0.5, '$$\mathrm{math\,\,mode\,\,roman}$$','interpreter','latex')
    

提交回复
热议问题