I am trying to fill to the left of a curve, rather than below it. When I tried fill between, I got:
Instead, the shading should be to the left of the curve, on the range [1.5,3].
My code:
\documentclass[preview]{standalone}
\linespread{1.25}
\usepackage{times}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\usetikzlibrary{positioning, arrows.meta}
\usepgfplotslibrary{fillbetween}
\usepackage{amsmath}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
scale = 1.2,
xmin = 0, xmax = 3,
ymin = 0, ymax = 3,
axis lines = left,
xtick = {0}, ytick = \empty,
axis on top,
clip = false,
]
% curve
\addplot [domain = 0:2, restrict y to domain = 0:3, samples=10000, thick, name path = curve]{exp(1.5-x)};
% horizontal line
\pgfmathsetmacro\myy{1.5}
\pgfmathsetmacro\myx{1.09453489}
\addplot [domain = 0:\myx, dashed, name path = line]{\myy};
% vertical line
\addplot[dashed] coordinates{(\myx,0) (\myx,\myy)};
% shading
\addplot [blue, opacity = 0.1] fill between [of = curve and line];
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
Can anyone help?