Is there a better method to have the x=0 and y=0 axes thicker? I made a basic approach by adding lines, but is there a better method?
\documentclass{book} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=0.8] \begin{axis}[ xmin=-2, xmax=6, ymin=-1.5, ymax=10, xtick={0,2,4}, ytick={0,2,4,6,8}, xmajorgrids=true, ymajorgrids=true, ytick style={draw=none}, xtick style={draw=none}, xlabel=$x$, ylabel=$y$, height=5cm, axis equal image ] \addplot [domain=-2:6, samples=100, color=blue!50, line width=1pt]{pow(x-2,2)}; \addplot [domain=-2:6, color=red!50, line width=1pt]{4}; \draw[line width=.5pt] ({axis cs:0,-2}) -- ({axis cs:0,10}); \draw[line width=.5pt] ({axis cs:-10,0}) -- ({axis cs:10,0}); \draw[line width=.5pt, green] (-2,0)--(0,0); \draw[green,fill=white] (0,0) circle(2pt); \draw[line width=.5pt, green] (4,0)--(6,0); \draw[green,fill=white] (4,0) circle(2pt); \end{axis} \end{tikzpicture} \end{document} This is not the same as pgfplots: how to make the axis thick? as that 'thicker' command results in thicker frame, not axes.
N.B. I don't want thicker arrow axes, I want thicker 'axes lines' in a framed plot. They do not seem to want to 'co-exist'.



axis lines=middle(like in the answer below) thenaxis line style=thickas in the duplicate would work. If you draw them manually then also\draw[thick] ({axis cs:0,-2}) -- ({axis cs:0,10});(or\draw[ultra thick]) works, which would keep the frame.