The font of my text are different of the font generated in figure in PGFplots. It is possible become these fonts be equal?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\setmainfont{QTAvanti}
\usepackage{etoolbox}
\usepackage{tikz}
\usepackage{fp}
\usepackage{xfp}
\usetikzlibrary{calc,fpu}
\usetikzlibrary{fixedpointarithmetic}
\usetikzlibrary{math}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{expl3}
\usepackage{amsmath}
\usetikzlibrary{math}
\begin{document}
\tikzmath{
\a = 0.5;
\b = 1;
\n=20;
}
\tikzset{fixed point arithmetic}
\tikzmath{
function f(\x) {
\y = (2 - exp(\x));
return \y;
};
int \i;
real \p;
real \P;
real \lb;
real \up;
\p = 0.5*(\a + \b);
for \i in {0,1,2,...,\n}{
\lb{\i} = \a;
\ub{\i} = \b;
\P{\i} = \p;
if (f(\a) <= 1e-8 && f(\p) >= 1e-8) || (f(\a) >= 1e-8 && f(\p) <= 1e-8)
then {\b = \p;}
else {\a = \p;};
\p = (\a+\b)/2;
};
}
\section{Introduction}
A fonte here is different of the figure generated by pgfplots....see below:
\vspace{2cm}
\foreach \i in {0}{
\begin{tikzpicture}[scale=2,font=\scriptsize,declare function = {
func(\x) = 2 - exp(\x);}]
\clip (-1,-1.5) rectangle (4.5,2);
\draw[teal] plot [smooth,domain=0:1.2] ({2\x},{func(\x)}) node[right]{$f(x)$};
\draw[->,-stealth] (-1,0) -- (3.2,0) node[right]{$x$};
\draw[->,-stealth] (0,-1.5) -- (0,1.5) node[above]{$y$};
\foreach \i in {0,0.5,...,1.5}{
\draw (2\i,2pt) -- (2\i,-2pt) node[below]{$\i$};
}
\foreach \i in {-1,-0.5,...,1}{
\draw (2pt,\i) -- (-2pt,\i) node[left,fill=white]{$\i$};
}
\draw[densely dotted] (2\lb{\i},0) -- (2\lb{\i},{func(\lb{\i})}) -- (0,{func(\lb{\i})});
\draw[densely dotted] (2\ub{\i},0) -- (2\ub{\i},{func(\ub{\i})}) -- (0,{func(\ub{\i})});
\fill[blue] (2\P{\i},0) circle (1pt);
\fill[blue] (2\P{\i},{func(\P{\i})}) circle (1pt);
\draw[densely dashed] (2\P{\i},0) node[below right]{$p_{\i}$} -- (2\P{\i},{func(\P{\i})});
\fill[red] (2\lb{\i},0) circle (1pt);
\fill[red] (2\ub{\i},0) circle (1pt);
\fill[teal] (2\lb{\i},{func(\lb{\i})}) circle (1pt);
\fill[teal] (2*\ub{\i},{func(\ub{\i})}) circle (1pt);
\node (T) at (1.8,1.5) {$p_{\i}=\fpeval{round(\P{\i},8)}$};
\node (T) at (1.8,1.7) {$a_{\i}=\fpeval{round(\lb{\i},8)}$};
\node (T) at (1.8,1.9) {$b_{\i}=\fpeval{round(\ub{\i},8)}$};
\end{tikzpicture}}
\end{document}
See in the figure the difference:
