-1

How drawing figure attache by TikZ?

\documentclass[border=0.5cm]{standalone}
\usepackage{tikz}

\begin{document} \begin{tikzpicture} \draw (-2.5,0) -- (2.5,0); \draw (0,-3) -- (0,3); \end{tikzpicture}

\end{document}

enter image description here

H.Gorbanzad
  • 355
  • 1
  • 10
  • What is a "figure attache"? I can not find it with google! Can you maybe rename your question, so others can find it in the future? Is it a figure eight? – hpekristiansen Nov 23 '20 at 19:58

3 Answers3

0

These are simple parametric plots. One parametrization that comes close is this one.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta,decorations.pathreplacing,decorations.markings}
\tikzset{->-/.style={decoration={% https://tex.stackexchange.com/a/39282/194703
  markings,
  mark=at position #1 with {\arrow{Stealth}}},postaction={decorate}},
  ->-/.default=0.55,
  -<-/.style={decoration={% https://tex.stackexchange.com/a/39282/194703
  markings,
  mark=at position #1 with {\arrow{Stealth[reversed]}}},postaction={decorate}},
  -<-/.default=0.55}
\tikzset{ rubout/.style={/utils/exec=\tikzset{rubout/.cd,#1},
 decoration={show path construction,
      curveto code={
       \draw [white,line width=\pgfkeysvalueof{/tikz/rubout/line width}+2*\pgfkeysvalueof{/tikz/rubout/halo}] 
        (\tikzinputsegmentfirst) .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)  ..(\tikzinputsegmentlast); 
       \draw [line width=\pgfkeysvalueof{/tikz/rubout/line width},shorten <=-0.1pt,shorten >=-0.1pt] (\tikzinputsegmentfirst) .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) ..(\tikzinputsegmentlast);  
      }}},rubout/.cd,line width/.initial=0.4pt,halo/.initial=0.8pt
}
\begin{document}
\begin{tikzpicture}[declare function={r=2;}] 
\begin{scope}
 \draw (-0.8*r,0) -- (0.8*r,0) (0,-1.1*r) -- (0,1.1*r);   
 \draw[postaction={rubout,decorate},-<-=0.08,-<-=0.18] 
    plot[variable=\t,domain=45:400,samples=61,smooth cycle] 
    ({0.67*r*sin(2*\t)},{r*cos(\t)});
\end{scope} 
\begin{scope}[xshift=5cm]
 \draw (-0.8*r,0) -- (0.8*r,0) (0,-1.1*r) -- (0,1.1*r);   
 \draw[postaction={rubout,decorate},-<-=0.58,-<-=0.68] 
    plot[variable=\t,domain=45:400,samples=61,smooth cycle] 
    ({0.67*r*sin(2*\t)},{r*cos(\t)});
\end{scope} 
\end{tikzpicture}
\end{document}

enter image description here

0
\documentclass[tikz, border=0.5cm]{standalone}
\usetikzlibrary{decorations.markings, arrows}  
\begin{document}
\begin{tikzpicture}
\draw (-2.5,0) -- (2.5,0);
\draw (0,-3) -- (0,3);
\begin{scope}[
    xscale=0.8, yscale=0.6,
    decoration={
    markings,
    mark=at position 0.56 with {\arrow{stealth}},
    mark=at position 0.45 with {\arrow{stealth}}
    }] 
\draw[thick, postaction={decorate}] (0,0) -- (1,-1) arc(45:-225:{sqrt(2)}) -- (1,1) arc (-45:225:{sqrt(2)}) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}

Figure eight with two arrows

0

A solution using to [out=out_angle, in=in_angle] and a little trick to plot the other (scale y = -1).

\documentclass[margin=5mm, varwidth]{standalone}

\usepackage{tikz}

\usetikzlibrary{calc,decorations.markings} \begin{document} \begin{tikzpicture}[decoration={ markings,% switch on markings mark=at position 1cm with {\arrow[black]{stealth}}, mark=at position -1cm with {\arrow[black]{stealth}} } ]

\begin{scope} \draw[-latex] (-1.5,0) -- (1.5,0); \draw[-latex] (0,-2.5) -- (0,2.5);

\draw[thick,postaction={decorate},shorten >=1mm,shorten <=1mm] (0,0) coordinate (O) to[out=45, in=-90] (1,1.4) to [out=90,in=0] (0,2) to[out=180,in=90] (-1,1.4) to[out=-90, in=135] (O) to[out=-45, in=90] (1,-1.4) to [out=-90,in=0] (0,-2) to[out=180,in=-90] (-1,-1.4) to[out=90, in=-135] (O) ;

\end{scope} \begin{scope}[xshift=4cm] \draw[-latex] (-1.5,0) -- (1.5,0); \draw[-latex] (0,-2.5) -- (0,2.5);

\begin{scope}[yscale=-1,xscale=1] \draw[thick,postaction={decorate},shorten >=1mm,shorten <=1mm] (0,0) coordinate (O) to[out=45, in=-90] (1,1.4) to [out=90,in=0] (0,2) to[out=180,in=90] (-1,1.4) to[out=-90, in=135] (O) to[out=-45, in=90] (1,-1.4) to [out=-90,in=0] (0,-2) to[out=180,in=-90] (-1,-1.4) to[out=90, in=-135] (O) ; \end{scope}

\end{scope}

\end{tikzpicture}

enter image description here

rpapa
  • 12,350