5

As a followup question to my answer here, I have a problem with the polaraxis of pgfplots. When I try to define xtick, nothing changes compared to dropping the option.

MWE

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}  
\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[xtick={0,45,...,360},]   
\end{polaraxis}
\end{tikzpicture}
\end{document}

Result (with x ticks in steps of 30° instead of 45°!) a simple polar axis

5

With your code I got the warning

Package pgfplots Warning: You have an axis with empty range (in direction ). Re placing it with a default range and clearing all plots.

So if there is no plot inside the polaraxis environment set at least a value for ymax.

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}  
\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[
  xtick={0,45,...,360},
  ytick={0,.5,1},
  ymax=1.1
  ]
\end{polaraxis}
\end{tikzpicture}
\end{document}

Result:

enter image description here

Alternative:

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}  
\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[
  xtick={0,45,...,360},
  ]
\addplot[draw=none]coordinates{(0,1)};
\end{polaraxis}
\end{tikzpicture}
\end{document}
  • Thanks a lot! One should never ignore warnings ;) , but somehow I missed this one.... – Faekynn Apr 13 '16 at 22:13

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.