Consider the following plot.
\documentclass{scrartcl}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
width=5cm,
height=7cm,
domain=-90:90,
xtick={-90, 0, 90},
ytick={-1, .6, 1, -.2},
]
\addplot {sin(x)};
\addplot {.2 - .4*sin(x)};
\end{axis}
\end{tikzpicture}
\end{document}
Say I want to have the tick labels for the y coordinates -1
and 0.6
on the left, but the ones for -0.2
and 1
on the right. How can I do that?
axis y line*=right
and add the y ticks to that one. As long asymin
andymax
for both axes coincide that works.