Responder1
Atualização 2 a pedido do OP
Criei um novo estilo chamado from infty
para representar o intervalo de -infinity
. Para colocar o texto sob as figuras, nomeei a caixa delimitadora como machado e coloquei um nó abaixo dela.
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}
Atualização a pedido do OP
Criei um novo estilo chamado to infty
para representar o intervalo até o infinito. Para colocar texto sob as figuras, nomeei a caixa delimitadora axe
e coloquei um nó abaixo dela.
O código é comentado com %<--
.
\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
Esses dois estilos são definidos, por padrão, aparece na figura anterior. É possível modificar oalturada curva e suacurvaturacom os seguintes parâmetros. Por exemplo my curve=12mm of .4
significa que a curva tem umalturade 12 mm
e que oPontos de controleda curva de Bézier estão localizados 0.4
no 1-0.4=0.6
caminho.
\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);
Primeira resposta
Eu reutilizei ominha curva 7código que escrevi aqui. Eu renomeei isso 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}}
Eu defini um pic
que permite desenhar uma marca e escrever um texto abaixo.
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}