Quero rotular um ponto (0,5066, -5,4) no eixo x, tento usar códigos. \node[label={180:{($\varepsilon_{cor}$)}},circle,fill,inner sep=2pt] at (axis cs:0.5066,-5.4) {};
Ele mostra a metade superior do rótulo. Como posso rotular um ponto no eixo e colocá-lo sob o eixo como um carrapato, mas não alterar o carrapato?
\begin{tikzpicture}
\pgfplotsset{width=10cm,}
\begin{axis}[
xlabel={$\varepsilon$ /\si{\volt}},
ylabel={$\lg \vert I \vert$},
axis lines = box,
xmin=0.18, xmax=0.82,
ymin=-5.4, ymax=-2.9,
xtick={0.2,0.3,0.4,0.5,0.6,0.7,0.8},
ytick={-5,-4.5,-4,-3.5,-3,-2.5,-2},
ymajorgrids=true,
grid style=dashed,]
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.2208 ,-3.05061)
(0.2809 ,-3.1549 )
(0.3309 ,-3.26761)
(0.3709 ,-3.38722)
(0.4008 ,-3.49485)
(0.4208 ,-3.58503)
(0.4309 ,-3.63827)
(0.4408 ,-3.69897)
(0.4508 ,-3.76955)
(0.4609 ,-3.85387)
(0.4708 ,-3.95861)
(0.4759 ,-4.04576)
(0.4808 ,-4.09691)
(0.4858 ,-4.22185)
(0.4909 ,-4.30103)
(0.4958 ,-4.52288)
(0.4978 ,-4.52288)
(0.4998 ,-4.69897)
(0.5019 ,-5 )
(0.5039 ,-5 )
(0.5063 ,-5.41 )};
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.5066 ,-5.41 )
(0.5101 ,-5 )
(0.5121 ,-5 )
(0.5141 ,-4.69897)
(0.5161 ,-4.69897)
(0.521 ,-4.39794)
(0.526 ,-4.30103)
(0.5311 ,-4.1549 )
(0.536 ,-4.09691)
(0.5411 ,-4 )
(0.5511 ,-3.88606)
(0.5611 ,-3.79588)
(0.5711 ,-3.72125)
(0.5811 ,-3.67778)
(0.5911 ,-3.61979)
(0.611 ,-3.52288)
(0.6412 ,-3.40894)
(0.6811 ,-3.30103)
(0.7311 ,-3.19382)
(0.7911 ,-3.09691)};
\node[label={180:{($\varepsilon_{cor}$)}},circle,fill,inner sep=2pt] at (axis cs:0.5066,-5.4) {};
\end{axis}
\end{tikzpicture}
Responder1
Use yshift
para mudar o rótulo. O nó com o rótulo se torna:
\node[label={[yshift=2ex]180:{($\varepsilon_{cor}$)}},circle,fill,inner sep=2pt] at (axis cs:0.5066,-5.4) {};
Deixando o resto como está agora, o resultado é:
EDITAR
Como foi solicitado pelo OP, incluo outra solução. Para posicionar o rótulo à direita do visto você deve especificar label={[right,yshift...
.
Tomei a liberdade de alinhá-lo manualmente
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepackage{amsmath,amssymb}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{width=10cm,}
\begin{axis}[
xlabel={$\varepsilon$ /\si{\volt}},
ylabel={$\lg \vert I \vert$},
axis lines = box,
xmin=0.18, xmax=0.82,
ymin=-5.4, ymax=-2.9,
xtick={0.2,0.3,0.4,0.5,0.6,0.7,0.8},
ytick={-5,-4.5,-4,-3.5,-3,-2.5,-2},
ymajorgrids=true,
grid style=dashed,]
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.2208 ,-3.05061)
(0.2809 ,-3.1549 )
(0.3309 ,-3.26761)
(0.3709 ,-3.38722)
(0.4008 ,-3.49485)
(0.4208 ,-3.58503)
(0.4309 ,-3.63827)
(0.4408 ,-3.69897)
(0.4508 ,-3.76955)
(0.4609 ,-3.85387)
(0.4708 ,-3.95861)
(0.4759 ,-4.04576)
(0.4808 ,-4.09691)
(0.4858 ,-4.22185)
(0.4909 ,-4.30103)
(0.4958 ,-4.52288)
(0.4978 ,-4.52288)
(0.4998 ,-4.69897)
(0.5019 ,-5 )
(0.5039 ,-5 )
(0.5063 ,-5.41 )};
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.5066 ,-5.41 )
(0.5101 ,-5 )
(0.5121 ,-5 )
(0.5141 ,-4.69897)
(0.5161 ,-4.69897)
(0.521 ,-4.39794)
(0.526 ,-4.30103)
(0.5311 ,-4.1549 )
(0.536 ,-4.09691)
(0.5411 ,-4 )
(0.5511 ,-3.88606)
(0.5611 ,-3.79588)
(0.5711 ,-3.72125)
(0.5811 ,-3.67778)
(0.5911 ,-3.61979)
(0.611 ,-3.52288)
(0.6412 ,-3.40894)
(0.6811 ,-3.30103)
(0.7311 ,-3.19382)
(0.7911 ,-3.09691)};
\node[label={[right,yshift=2.1ex,xshift=0.3em]180:{($\varepsilon_{\mathrm{cor}})=0.5066$}},circle,fill,inner sep=2pt] at (axis cs:0.5066,-5.4) {};
\end{axis}
\end{tikzpicture}
\end{document}
Produzindo:
EDITAR2
Reposicionei a etiqueta no eixo.
A parte principal é:
extra x ticks={0.5066},
extra x tick labels={$\varepsilon_{\mathrm{cor}} ({\scriptstyle 0.5066})$},
Além disso, eu meio que corrigi a marca do eixo:
\node[circle,fill,inner sep=1.5pt] at (axis cs:0.5066,-5.4) {};
O código é:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepackage{amsmath,amssymb}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{width=10cm,}
\begin{axis}[
xlabel={$\varepsilon$ /\si{\volt}},
ylabel={$\lg \vert I \vert$},
axis lines = box,
xmin=0.18, xmax=0.82,
ymin=-5.4, ymax=-2.9,
xtick={0.2,0.4,0.6,0.8},
ytick={-5,-4,-3,-2},
ymajorgrids=true,
extra x ticks={0.5066},
extra x tick labels={$\varepsilon_{\mathrm{cor}} ({\scriptstyle 0.5066})$},
grid style=dashed,]
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.2208 ,-3.05061)
(0.2809 ,-3.1549 )
(0.3309 ,-3.26761)
(0.3709 ,-3.38722)
(0.4008 ,-3.49485)
(0.4208 ,-3.58503)
(0.4309 ,-3.63827)
(0.4408 ,-3.69897)
(0.4508 ,-3.76955)
(0.4609 ,-3.85387)
(0.4708 ,-3.95861)
(0.4759 ,-4.04576)
(0.4808 ,-4.09691)
(0.4858 ,-4.22185)
(0.4909 ,-4.30103)
(0.4958 ,-4.52288)
(0.4978 ,-4.52288)
(0.4998 ,-4.69897)
(0.5019 ,-5 )
(0.5039 ,-5 )
(0.5063 ,-5.41 )};
\addplot[
color=black,
mark=*, mark size=1.5,
]
coordinates {
(0.5066 ,-5.41 )
(0.5101 ,-5 )
(0.5121 ,-5 )
(0.5141 ,-4.69897)
(0.5161 ,-4.69897)
(0.521 ,-4.39794)
(0.526 ,-4.30103)
(0.5311 ,-4.1549 )
(0.536 ,-4.09691)
(0.5411 ,-4 )
(0.5511 ,-3.88606)
(0.5611 ,-3.79588)
(0.5711 ,-3.72125)
(0.5811 ,-3.67778)
(0.5911 ,-3.61979)
(0.611 ,-3.52288)
(0.6412 ,-3.40894)
(0.6811 ,-3.30103)
(0.7311 ,-3.19382)
(0.7911 ,-3.09691)};
\node[circle,fill,inner sep=1.5pt] at (axis cs:0.5066,-5.4) {};
\end{axis}
\end{tikzpicture}\end{document}
E aqui está o resultado
Basicamente:
Reduzi os ticks em ambos os eixos (você pode fazer como quiser)
Forneci uma marca extra no eixo x, com
extra x ticks
Forneci um rótulo para a marca extra (você pode querer ajustar o estilo, por exemplo, com um
\small
ou revisar os números)Retirei a etiqueta da trama, sendo redundante
Reduzi
inner sep
o tick único no eixo para1.5pt
e pode exigir ajuste fino
Acho que você pode pegar aqui.