From: leo nidas on


Hi there,

I have a figure in matlab and use it in a latex document. The problem is that the font i the text of the figure is different than the font of the main text in the latex document. Is there a way of making the font of the text of the figure the same as the latex document? I saw some functions in the FEX like fig2tex and matlabfrag that may do the job but due to my inexperience I was not able to use them.

I provide the latex document containing one sentence (I use Miktex,Texniccenter if that helps) and below is the matlab code that provides the graph "regions".

Can anyone provide the one or two line code using any function to to the job? I will download whatever is necessary from the FEX. Thanx in advance!!!

\documentclass[11pt]{article}
\usepackage{graphicx}
\begin{document}
Observe that the following graph has a different font than the one used in this sentence.

\begin{figure}[h]
\includegraphics[width=13cm]{regions}
\end{figure}
\end{document}


The matlab gifure is created by the following (I save it as regions.eps ):

g=0:0.01:6;n=length(g);up=0.2;
axis([0 6 -1 3.3])
hold on
plot(g(g>up),1./g(g>up),'LineWidth',2.5,'Color','black')

plot(g,ones(n,1),'LineWidth',2.5,'Color','black')

plot(g,zeros(n,1),'LineWidth',2.5,'Color','black')
fonts=10.5;

text('Interpreter','latex',...
'String','Second region',...
'Position',[.3 .5],...
'FontSize',fonts)

text('Interpreter','latex',...
'String','Third region',...
'Position',[4.5 .5],...
'FontSize',fonts)

text('Interpreter','latex',...
'String','Third region',...
'Position',[2.6 -0.5],...
'FontSize',fonts)

text('Interpreter','latex',...
'String','First region',...
'Position',[2.6 2.3],...
'FontSize',fonts)

xlabel('$\gamma$','FontSize',11,'interpreter','latex')
ylabel('$\alpha$','FontSize',11,'interpreter','latex')
From: Tim Love on
On Jul 18, 9:36 am, "leo nidas" <bleonida...(a)yahoo.gr> wrote:
> Hi there,
>
> I have a figure in matlab and use it in a latex document. The problem is that the font i the text of the figure is different than the font of the main text in the latex document. Is there a way of making the font of the text of the figure the same as the latex document?

Either change the font in Matlab (using the FontName property) or
change the font in LaTeX (using \usepackage{helvetic} perhaps).