# Position some yticks to the right, and some others, to the left

I am trying to position the yticks to the left and right of the axis, depending on a comparaion to a reference value. Say in the following plot, I want to position the positive ylabels to the left, and the negatives ones to the right of the axis.

The code is as follows (and it is token from a previous poste)

\documentclass{article}
\usepackage{tikz,pgfplots}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[>=latex]
\begin{axis}[
axis x line=center,
axis y line=center,
xtick={-5,-4,...,5},
ytick={-5,-4,...,5},
xlabel={$x$},
ylabel={$y$},
xlabel style={below right},
ylabel style={above left},
xmin=-5.5,
xmax=5.5,
ymin=-5.5,
ymax=5.5]

\end{axis}
\end{tikzpicture}
\end{document}

-
Would such a design not interfere with the ticks on the negative axis and the negative numbers? – Christian Hupfer Mar 8 '14 at 16:09
No, I can iterate. the point is that my plot is in the second and fourth quarters. So I want to move the positve yticks to the right of the y axis, and the positive xticks above the xaxis – user2536125 Mar 8 '14 at 16:19
I am confused: In your question you wanted to shift the positive values to the left (where they usually are) and the negative labels to the right of the axis -- now it is the other way round? – Christian Hupfer Mar 8 '14 at 16:23

you could use something like this:

\documentclass{article}
\usepackage{tikz,pgfplots}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[>=latex]
\begin{axis}[
axis x line=center,
axis y line=center,
xtick={-5,-4,...,5},
ytick={0,1,...,5},
xlabel={$x$},
ylabel={$y$},
xlabel style={below right},
ylabel style={above left},
xmin=-5.5,
xmax=5.5,
ymin=-5.5,
ymax=5.5,
extra y ticks={-5,-4,-3,-2,-1},
extra y tick style={yticklabel style={xshift=0.5ex, anchor=west}}
]
\end{axis}
\end{tikzpicture}
\end{document}


however, as commented above, the tick labels will interefere

-
Thnaks, That was exactly what I was looking for – user2536125 Mar 8 '14 at 16:39