4 Answers
No need for an AI to draw something like this.
\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}
-
-
1Alternative:
\draw[thick, ->] (1) to[out=-30, in=150, looseness=2] (2);
. Commented Apr 2, 2023 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.– SebGlavCommented Apr 3, 2023 at 7:54
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:
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}
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.
-
1
-
1I asked for an S-shaped curve between two vertical points. I took some subsequent suggestions, but I got there eventually. Commented Apr 2, 2023 at 15:39
-
3Why would you rotate everything by 90 degrees and not define the coordinates directly in a proper way? The mysteries of artificial intelligence ... Commented Apr 2, 2023 at 20:36
TikZ
tutorial. Then propose your partial solution and we will help you to go beyond.