I would like to add an arrowhead in the middle of a plot but `mark` is not working. I also tried `\arrow[red]{stealth}` instead of `>` but it gives me an error. Here is my code

```
\documentclass[a4paper,12pt]{book}

\usepackage{fontspec}
\usepackage{amsmath,empheq}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=newest}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{patterns}
\usetikzlibrary{calc}

\begin{document}

\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\begin{axis}[
axis on top,
width=0.8\textwidth,
axis equal image,
xmin=0,
xmax=4,
ymin=0,
ymax=4,
]
\path[name path=axis] (1,0)--(3,0);
\addplot[name path=f,smooth,mark=at position 2 with >,domain=1:3,samples=200,blue,thick]{12/(x+3)};
\addplot[yellow] fill between[of=f and axis];
\draw[dashed] (1,3)--(1,0);
\draw[dashed] (3,2)--(3,0);
\fill (1,3) circle (1.5pt);
\fill (3,2) circle (1.5pt);
\end{axis}
\end{tikzpicture}
\caption{}
\label{}
\end{figure}

\end{document}

```

And here is the image I get that is missing the arrowhead.

[![enter image description here](https://i.stack.imgur.com/EmvMO.jpg)](https://i.stack.imgur.com/EmvMO.jpg)

This is the code updated following the suggestion of user LaTexDraw-com

```
\documentclass[a4paper,12pt]{book}

\usepackage{fontspec}
\usepackage{amsmath,empheq}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=newest}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{patterns}
\usetikzlibrary{calc}

\tikzstyle witharrow=[postaction={decorate,decoration={markings,mark=at position 0.5 with {\arrow[#1]{stealth}}}}] 

\begin{document}

\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\begin{axis}[
axis on top,
width=0.8\textwidth,
axis equal image,
xmin=0,
xmax=4,
ymin=0,
ymax=4,
]
\path[name path=axis] (1,0)--(3,0);
\addplot[name path=f,domain=1:3,samples=200,blue,thick,witharrow=red]{12/(x+3)};
\addplot[yellow] fill between[of=f and axis];
\draw[dashed] (1,3)--(1,0);
\draw[dashed] (3,2)--(3,0);
\fill (1,3) circle (1.5pt);
\fill (3,2) circle (1.5pt);
\end{axis}
\end{tikzpicture}
\caption{}
\label{}
\end{figure}

\end{document}

```

but now I have another problem, the filling is wrong as you can see from the image below

[![enter image description here](https://i.stack.imgur.com/YeJiv.jpg)](https://i.stack.imgur.com/YeJiv.jpg)