2

I'm trying to reverse the y axis of my polaraxis plot while keeping the zero towards east. This is supposed to produce a clockwise polar plot.

However, the tick anchors are not mirrored in the correct way.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.polar} 

\begin{document}

\begin{figure}
 \begin{tikzpicture} 
\begin{polaraxis}[
    y dir=reverse
]
\addplot table{
    0 1 
    30 2
    60 4
    90 6
    120 4
    };
\end{polaraxis} 
\end{tikzpicture}
\end{figure}

\end{document}

enter image description here

How can I get that fixed? A similar problem is given in Reverse xaxis on polar plot

  • [x tick label style={anchor=center}] doesn't exactly fix it, but at least it is consistent. ]xticklabel shift=-2.5mm] has about the same effect. – John Kormylo Aug 27 '15 at 15:34
2

With xticklabel style={anchor=180-\tick} you can fix anchor of xticklabel on this reversed y axis, to drive away tick labels from the center you can add inner xsep=2mm.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.polar} 

\begin{document}

\begin{figure}
 \begin{tikzpicture} 
\begin{polaraxis}[
    y dir=reverse,
    xticklabel style={anchor=180-\tick}]
\addplot table{
    0 1 
    30 2
    60 4
    90 6
    120 4
    };
\end{polaraxis} 
\end{tikzpicture}
\end{figure}

\end{document}

enter image description here

  • Short and simple, yet effective! Thanks a lot! – ProtonK Aug 28 '15 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.