2

I think, that I miss the obvious!

  • I want to create a (empty) polar diagram with the pgfplots package.
  • I want to add some custom annotations etc. using tikz commands (\draw or \node, for example).
  • Problem: It seems, that my custom annotations are not rendered?!

\documentclass[border=10pt]{standalone} % Problem also occurs in "article" class.

\usepackage{pgfplots}
\pgfplotsset{compat=1.16} % Does not seem to be relevant to my issue.
\usepgfplotslibrary{polar}

% Nice sans-serif font, irrelevant to the question :)
\usepackage{arev}

\begin{document}

\begin{tikzpicture}
    \begin{polaraxis}
    [
        % Options
        width = 120mm,
        height = 120mm,
        scale only axis, % Does not seem to be relevant to my issue.    
        xmin = 0,
        xmax = 360,
        ymin = -1,
        ymax = 1,
        yticklabels = {},
        ylabel = {ylabel},
        xlabel = {xlabel},
    ]
    % \addplot etc.
    % No effect?!
    \node at (0,0) {Annotation};
    \end{polaraxis}
\end{tikzpicture}

\end{document}

enter image description here

2

It appears to me that you have confused pgfplots by allowing for negative radii with ymin = -1. If you use only nonnegative boundaries, ymin=0 say, you get.

\documentclass[border=10pt]{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{polar}

% Nice sans-serif font, irrelevant to the question :)
%\usepackage{arev}

\begin{document}

\begin{tikzpicture}
    \begin{polaraxis}
    [
        % Options
        width = 120mm,
        height = 120mm,
        scale only axis,    
        xmin = 0,
        xmax = 360,
        ymin = 0,
        ymax = 1,
        yticklabels = {},
        ylabel = {ylabel},
        xlabel = {xlabel},
    ]
    % \addplot etc.
    % No effect?!
    \node at (0,0) {Annotation};
    \end{polaraxis}
\end{tikzpicture}

\end{document}

enter image description here

7
  • OMG! How do I get then a yline that goes from left to right (180° to 0° in the picture)? – Dr. Manuel Kuehner Feb 6 '20 at 17:51
  • @Dr.ManuelKuehner Would adding \draw (0,1) -- (180,1); be acceptable for you? – user194703 Feb 6 '20 at 17:53
  • Yes, if this is the "clean" approach. To change the axis seems more natural to me. I naturally assumed that ymin = -1 makes sense and the output also looked good :). – Dr. Manuel Kuehner Feb 6 '20 at 17:54
  • @Dr.ManuelKuehner I think it is cleaner than negative radii, I think. ;-) – user194703 Feb 6 '20 at 17:54
  • 1
    @Dr.ManuelKuehner I think we need to wait to v1.17 for that. ;-) – user194703 Feb 6 '20 at 18:00

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.