4

I would like to specify a custom tick with a custom label at a sp

\begin{axis}[       
symbolic y coords={<{Critical point} at 2.138  ???>},
]
\addplot+[samples=100,domain=-2:2] {x^2};
\end{axis}
9

You have to use extra y ticks to specify the ticks you want to customize and extra y tick style to specify their style, for example:

\documentclass[border=2pt]{standalone}

\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    extra y ticks={2.18},
    extra y tick style={
        grid=major,
        yticklabel={$P_c$},
        yticklabel style={yshift=0.7ex, anchor=east}}]
\addplot+[samples=100,domain=-2:2] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.