Respuesta1
Actualización 2 a petición de OP
Creé un nuevo estilo llamado from infty
para representar el intervalo desde -infinity
. Para colocar texto debajo de las figuras, nombré el cuadro delimitador hacha y coloqué un nodo debajo.
from infty/.style args={#1of#2}{%<-- new style "from infty"
to path={($(\tikztostart)!#1!90:(\tikztotarget)$).. controls ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget) \tikztonodes}}
\documentclass[tikz,border=5mm]{standalone}
%\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,quotes}
\begin{document}
\tikzset{my curve/.style args={#1of#2}{
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
and ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
my curve/.default={7mm of 0.25},
to infty/.style args={#1of#2}{%<-- new style "to infty"
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. ($(\tikztotarget)!#1!90:(\tikztotarget)$) \tikztonodes}},
from infty/.style args={#1of#2}{%<-- new style "from infty"
to path={($(\tikztostart)!#1!90:(\tikztotarget)$).. controls ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget) \tikztonodes}},
to infty/.default={7mm of 0.4},
from infty/.default={7mm of 0.4}}
\begin{tikzpicture} [pics/tick/.style={code={\draw ++(0,-.2)node[below]{#1}--++(0,.4);}}]
\begin{scope}[local bounding box=axe]%<-- bounding box "axe"
\coordinate (z') at (-2,0);
\coordinate (c) at (1,0);
\coordinate (b) at (4,0);
\coordinate (a) at (6,0);
\coordinate (z) at (9,0);
\draw[-{Stealth[]}] (-2,0)--(10,0);
\pic at (c){tick=c};
\pic at (b){tick=b};
\pic at (a) {tick=a};
%\pic at (z) {tick};
\draw (z')to["4"{draw,circle},from infty](c) to["2"{draw,circle},my curve] (b) to ["3"{draw,circle},my curve] (a) to ["1"{draw,circle},to infty](z);
\end{scope}
\node[below] at (axe.south){My axis};%<-- node to add caption
\end{tikzpicture}
\end{document}
Actualización a petición del OP
Creé un nuevo estilo llamado to infty
para representar el intervalo hasta el infinito. Para colocar texto debajo de las figuras, nombré el cuadro delimitador axe
y coloqué un nodo debajo de él.
El código está comentado con %<--
.
\documentclass[tikz,border=5mm]{standalone}
%\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,quotes}
\begin{document}
\tikzset{my curve/.style args={#1of#2}{
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
and ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
my curve/.default={7mm of 0.25},
to infty/.style args={#1of#2}{%<-- new style "to infty"
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. ($(\tikztotarget)!#1!90:(\tikztotarget)$) \tikztonodes}},
to infty/.default={7mm of 0.4}}
\begin{tikzpicture} [pics/tick/.style={code={\draw ++(0,-.2)node[below]{#1}--++(0,.4);}}]
\begin{scope}[local bounding box=axe]%<-- bounding box "axe"
\coordinate (c) at (1,0);
\coordinate (b) at (4,0);
\coordinate (a) at (6,0);
\coordinate (z) at (9,0);
\draw[-{Stealth[]}] (0,0)--(10,0);
\pic at (c){tick=c};
\pic at (b){tick=b};
\pic at (a) {tick=a};
%\pic at (z) {tick};
\draw (c) to["2"{draw,circle},my curve] (b) to ["3"{draw,circle},my curve] (a) to ["1"{draw,circle},to infty](z);
\end{scope}
\node[below] at (axe.south){My axis};%<-- node to add caption
\end{tikzpicture}
\end{document}
Parámetros de curva
Estos dos estilos están configurados, por defecto, aparece en la figura anterior. Es posible modificar elalturade la curva y sucurvaturacon los siguientes parámetros. Por ejemplo my curve=12mm of .4
significa que la curva tiene unaalturade 12 mm
y que elpuntos de controlde la curva de Bézier se encuentran en 0.4
y 1-0.4=0.6
del camino.
\draw (c) to["2"{draw,circle},my curve=12mm of .4] (b) to ["3"{draw,circle},my curve=8mm of .2] (a) to ["1"{draw,circle},to infty=15mm of .6](z);
Primera respuesta
Reutilicé elmi curva 7código que escribí aquí. Le cambié el nombre my curve
.
\tikzset{my curve/.style args={#1of#2}{
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
and ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
my curve/.default={7mm of 0.25}}
Definí uno pic
que te permite dibujar una marca y escribir texto debajo.
pics/tick/.style={code={\draw ++(0,-.2)node[below]{#1}--++(0,.4);}}
Resultado:
Código:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,quotes}
\begin{document}
\tikzset{my curve/.style args={#1of#2}{
to path={.. controls ($(\tikztostart)!#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
and ($(\tikztostart)!1-#2!(\tikztotarget)!#1!90:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
my curve/.default={7mm of 0.25}}
\begin{tikzpicture} [pics/tick/.style={code={\draw ++(0,-.2)node[below]{#1}--++(0,.4);}}]
\coordinate (c) at (1,0);
\coordinate (b) at (4,0);
\coordinate (a) at (6,0);
\coordinate (z) at (9,0);
\draw[-{Stealth[]}] (0,0)--(10,0);
\pic at (c){tick=c};
\pic at (b){tick=b};
\pic at (a) {tick=a};
\pic at (z) {tick};
\draw (c) to["2"{draw,circle},my curve] (b) to ["3"{draw,circle},my curve] (a) to ["1"{draw,circle},my curve](z);
\end{tikzpicture}
\end{document}