[Tex/LaTex] PgfPlot with Y-axis only on the right hand side

pgfplots

I'm trying to draw graph similar to the one below with the Y-axis only on the RHS.

A graph with the Y-axis only on the right hand side.

The following MWE produces something close the desired result:

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[scale=0.75]
    \begin{axis}[ylabel=Y-Axis, xlabel=X-Axis
, xmin=2, xmax=10, ymin=0, ymax=12, clip=false, axis y line*=right]
    \foreach \blah in {0.9,0.5,0.2,0.1,0.05,0.02,0.01,0.005}{
        \addplot[mark=none, domain=2:10, thick] {-ln(\blah/x^2)/ln(x)} node [pos=0,left] {$c_2=$}; %Varying c_2 values
    }
    \end{axis}
\end{tikzpicture}

\end{document}

as this image shows:

Graph showing the Y-axis almost on the right hand side, but the line on the left has disappeared

The y-axis label has not moved to the right and the box line on the left has disappeared entirely.

Any thoughts on how to make things right and get a y-axis on the right-hand side and a box line on the left-hand side?

Thanks!

Best Answer

Replace axis y line*=right with ylabel near ticks, yticklabel pos=right (Thanks Jake):

enter image description here

Code:

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[scale=0.75]
    \begin{axis}[
        ylabel=Y-Axis, xlabel=X-Axis, 
        xmin=2, xmax=10, ymin=0, ymax=12, clip=false, 
        %axis y line*=right% replaced this option with:
        ylabel near ticks, yticklabel pos=right
        ]
    \foreach \blah in {0.9,0.5,0.2,0.1,0.05,0.02,0.01,0.005}{
        \addplot[mark=none, domain=2:10, thick] {-ln(\blah/x^2)/ln(x)} node [pos=0,left] {$c_2=$}; %Varying c_2 values
    }
    \end{axis}
\end{tikzpicture}

\end{document}