-1

How to draw the following picture in Latex/Tikz:enter image description here

Sebastiano
  • 54,118
  • Take one of my drawing (!) from https://tex.stackexchange.com/q/681418/245790 and check for "hair", "horn", "eye" etc. Then you can vary the line from straight to curved. See the tikz manual for modifying arrow tips. – MS-SPO Apr 02 '23 at 14:10
  • Start to read basic TikZ tutorial. Then propose your partial solution and we will help you to go beyond. – projetmbc Apr 02 '23 at 14:18
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 02 '23 at 14:22

4 Answers4

7

No need for an AI to draw something like this.

S between two dots

\documentclass[tikz,border=3.14mm]{standalone}

\begin{document} \begin{tikzpicture}[ dot/.style={ inner sep=0pt, outer sep=1pt, minimum width=4pt, circle, fill=black}] \node[dot] (1) at (0,0) {}; \node[dot] (2) at (0,-5) {}; \draw[thick,->] (1) .. controls ++ (3,-2) and ++ (-3,2) .. (2); \end{tikzpicture} \end{document}

SebGlav
  • 19,186
  • It it possible to have more than one control point? – Jean Robert Apr 02 '23 at 19:19
  • 1
    Alternative: \draw[thick, ->] (1) to[out=-30, in=150, looseness=2] (2);. – Jasper Habicht Apr 02 '23 at 20:39
  • 2
    @JeanRobert There already is two control points on this curve. One for each vertex. If you want more flexibility, you'll have to define more vertices, then add control points around them. You could find more info by searching for Bezier curve. – SebGlav Apr 03 '23 at 07:54
6

For what it's worth, an alternative with Metapost.

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
z1 = -z2 = 30 up;
draw z1 withpen pencircle scaled 3;
draw z2 withpen pencircle scaled 3;
drawarrow z1 {dir -20} .. z2 {dir -20}
    cutbefore fullcircle scaled 7 shifted z1
    cutafter  fullcircle scaled 7 shifted z2;
endfig;
\end{mplibcode}
\end{document}

Compile with lualatex to get:

enter image description here

Thruston
  • 42,268
3

Since it seems you're drawing a commutative diagram, a solution with tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}
\tikzset{mydot/.style={% style copied from SebGlav's answer 
            inner sep=0pt,
            outer sep=1pt,
            minimum width=4pt,
            circle,
            fill=black}
            }

\begin{document} [ \begin{tikzcd}[ every matrix/.append style={ nodes in empty cells, nodes={mydot} }, row sep=3cm, ] \ar[d,out=0,in=180]\ \end{tikzcd} ] \end{document}

enter image description here

CarLaTeX
  • 62,716
0

For anybody out there - who like me does not know so much about TikZ - here is the answer I got from an AI:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=2,rotate=90]
\draw[thick, ->, shorten <= 4pt, shorten >= 4pt] (0.5,0) .. controls (0.25,-0.5) and (-0.25,0.5) .. (-0.5,0) node[pos=0.5, above left] {$f$}; \filldraw[black] (-0.5,0) circle (1pt) node[above] {$A$};
\filldraw[black] (0.5,0) circle (1pt) node[below] {$B$}; \end{tikzpicture}

\end{document}

From this example, it's easy to see how basic curved arrows work, and how to build them in general.

projetmbc
  • 13,315
  • 1
    How was the question that you made to the generator? – Andre Apr 02 '23 at 15:23
  • 1
    I asked for an S-shaped curve between two vertical points. I took some subsequent suggestions, but I got there eventually. – Jean Robert Apr 02 '23 at 15:39
  • 3
    Why would you rotate everything by 90 degrees and not define the coordinates directly in a proper way? The mysteries of artificial intelligence ... – Jasper Habicht Apr 02 '23 at 20:36