I have two graphics that I would like to join into one but even more I would like to put them inside text, something like this:
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{lipsum}
\begin{document}
\lipsum[66]
\begin{figure}[h]
\centering
...
\end{figure}
\lipsum[66]
\end{document}
the codes of my graphs are the following:
\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usepackage[spanish,es-noshorthands]{babel}
\begin{document}
\begin{tikzpicture}
\draw[-stealth] (-1,0) -- (2.5,0) node[below]{$u$};;
\draw[-stealth] (0,-1) -- (0,2.5) node[left]{$v$};
\draw[blue] (-0.8,2)--(2.3,2);
\draw[blue] (-0.8,0.5)--(2.3,0.5);
\draw[red] (2,-0.8)--(2,2.3);
\draw[red] (0.5,-0.8)--(0.5,2.3);
\node at (0,2) [blue, font=\footnotesize, below left]{$1$};
\node at (0,0.5) [blue, font=\footnotesize, below left]{$1$};
\node at (2,0) [red, font=\footnotesize, below left]{$1$};
\node at (0.5,0) [red, font=\footnotesize, below left]{$1$};
\end{tikzpicture}
\end{document}
and
\documentclass[tikz,border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=10cm}
\tikzset{declare function={torusx(\u,\v,\R,\r)=cos(\u)*(\R + \r*cos(\v));
torusy(\u,\v,\R,\r)=(\R + \r*cos(\v))*sin(\u);
torusz(\u,\v,\R,\r)=\r*sin(\v);
vcrit1(\u,\th)=atan(tan(\th)*sin(\u));% first critical v value
vcrit2(\u,\th)=180+atan(tan(\th)*sin(\u));% second critical v value
vtest(\u,\v,\az,\el)=sin(-vcrit1(\u-\az,\el)+\v);
disc(\th,\R,\r)=((pow(\r,2)-pow(\R,2))*pow(cot(\th),2)+%
pow(\r,2)*(2+pow(tan(\th),2)))/pow(\R,2);% discriminant
umax(\th,\R,\r)=ifthenelse(disc(\th,\R,\r)>0,asin(sqrt(abs(disc(\th,\R,\r)))),0);
}}
\pgfplotsset{visible stretch/.style={restrict expr to domain={vtest(atan2(rawy,rawx),%
ifthenelse(veclen(rawx,rawy)>\R,asin(rawz/\r),180-asin(rawz/\r)),\pgfkeysvalueof{/pgfplots/view/az},\pgfkeysvalueof{/pgfplots/view/el})}{-0.05:1.1}},
hidden stretch/.style={restrict expr to
domain={vtest(atan2(rawy,rawx),%
ifthenelse(veclen(rawx,rawy)>\R,asin(rawz/\r),180-asin(rawz/\r)),\pgfkeysvalueof{/pgfplots/view/az},\pgfkeysvalueof{/pgfplots/view/el})}{-1.1:0.05}}}
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\R}{2}
\pgfmathsetmacro{\r}{1}
\pgfplotsset{view={35}{60},axis lines=none}
\begin{axis}[]
\pgfplotsinvokeforeach{0,10,...,350}
{\addplot3[samples y=0,domain=0:361,smooth,samples=71,ultra thin,gray!30]
({torusx(x,#1+x/12,\R,\r)},
{torusy(x,#1+x/12,\R,\r)},
{torusz(x,#1+x/12,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,ultra thin,gray!30]
({torusx(#1,x,\R,\r)},
{torusy(#1,x,\R,\r)},
{torusz(#1,x,\R,\r)});
}
\pgfplotsinvokeforeach{0,10,...,350}
{\addplot3[samples y=0,domain=0:361,smooth,samples=71,visible stretch,very
thin,gray!50]
({torusx(x,#1+x/12,\R,\r)},
{torusy(x,#1+x/12,\R,\r)},
{torusz(x,#1+x/12,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,visible stretch,very
thin,gray!50]
({torusx(#1,x,\R,\r)},
{torusy(#1,x,\R,\r)},
{torusz(#1,x,\R,\r)});}
\addplot3[samples y=0,domain=0:360,smooth,samples=71,opacity=0.6,
red,very thick,dashed]
({torusx(-90,x,\R,\r)},
{torusy(-90,x,\R,\r)},
{torusz(-90,x,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,visible
stretch,red,very thick]
({torusx(-90,x,\R,\r)},
{torusy(-90,x,\R,\r)},
{torusz(-90,x,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,opacity=0.6,
red,very thick,dashed]
({torusx(0,x,\R,\r)},
{torusy(0,x,\R,\r)},
{torusz(0,x,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,visible
stretch,red,very thick]
({torusx(0,x,\R,\r)},
{torusy(0,x,\R,\r)},
{torusz(0,x,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,opacity=0.6,
blue,very thick,dashed]
({torusx(x,0,\R,\r)},
{torusy(x,0,\R,\r)},
{torusz(x,0,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,visible
stretch,blue,very thick]
({torusx(x,0,\R,\r)},
{torusy(x,0,\R,\r)},
{torusz(x,0,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,opacity=0.6,
blue,very thick,dashed]
({torusx(x,80,\R,\r)},
{torusy(x,80,\R,\r)},
{torusz(x,80,\R,\r)});
\addplot3[samples y=0,domain=0:360,smooth,samples=71,visible
stretch,blue,very thick]
({torusx(x,80,\R,\r)},
{torusy(x,80,\R,\r)},
{torusz(x,80,\R,\r)});
\end{axis};
\end{tikzpicture}
\end{document}
I would like the result to be something like this: