Here's one option; the mark max, mark min styles receive an optional argument allowing to specify the position of the node with the coordinates for the maximum (the defaults are above for the maximum and below for the minimum):
\documentclass{article}
\usepackage{pgfplots}
\makeatletter
\pgfplotsset{
compat=1.12,
/tikz/max node/.style={
anchor=south,
},
/tikz/min node/.style={
anchor=north,
name=minimum
},
mark min/.style={
point meta rel=per plot,
visualization depends on={x \as \xvalue},
scatter/@pre marker code/.code={%
\ifx\pgfplotspointmeta\pgfplots@metamin
\def\markopts{}%
\coordinate (minimum);
\node[#1] {(\pgfmathprintnumber[fixed]{\xvalue},\pgfmathprintnumber[fixed]{\pgfplotspointmeta})};%
\else
\def\markopts{mark=none}
\fi
\expandafter\scope\expandafter[\markopts,every node near coord/.style=green]
},%
scatter/@post marker code/.code={%
\endscope
},
scatter,
},
mark min/.default={below},
mark max/.style={
point meta rel=per plot,
visualization depends on={x \as \xvalue},
scatter/@pre marker code/.code={%
\ifx\pgfplotspointmeta\pgfplots@metamax
\def\markopts{}%
\coordinate (maximum);
\node[#1] {(\pgfmathprintnumber[fixed]{\xvalue},\pgfmathprintnumber[fixed]{\pgfplotspointmeta})};%
\else
\def\markopts{mark=none}
\fi
\expandafter\scope\expandafter[\markopts]
},%
scatter/@post marker code/.code={%
\endscope
},
scatter
},
mark max/.default={above},
}
\makeatother
\usepackage{filecontents}
\begin{filecontents*}{sample.table}
x y
1 0.2
10 0.1
20 0.4
30 -0.3
40 0.3
50 -0.2
\end{filecontents*}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xlabel={X},
ylabel={Y},
xmax=50,
xmin=0,
ymax=.5,
ymin=-.5,
width=15cm,
height=5cm,
]
\addplot[blue,smooth,mark max=right]table{sample.table};
\end{axis}
\end{tikzpicture}
\caption{Caption}
\end{figure}
\end{document}

I used a variation of Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?
ymode=logbreaks the(x,y)label as it displays(x,log(y)). What do you suggest to circumvent this ? @Jake, what is your opinion on this as original poster ? – BambOo May 10 '19 at 13:39point meta={exp(y)}to theaxisoptions corrects the output, which I find somewhat weird, but fits my need. – BambOo May 10 '19 at 14:48