![pgfplots:polaraxis | polar | 无法添加注释(\draw,\node)](https://linux22.com/image/407702/pgfplots%EF%BC%9Apolaraxis%20%7C%20polar%20%7C%20%E6%97%A0%E6%B3%95%E6%B7%BB%E5%8A%A0%E6%B3%A8%E9%87%8A%EF%BC%88%5Cdraw%EF%BC%8C%5Cnode%EF%BC%89.png)
我想,我忽略了显而易见的东西!
- 我想用该
pgfplots
包创建一个(空的)极坐标图。 - 我想添加一些自定义注释等等使用
tikz
命令(例如\draw
或)。\node
- 问题:看起来,我的自定义注释没有被呈现?!
\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}
答案1
在我看来,您pgfplots
把允许负半径与混淆了ymin = -1
。如果您只使用非负边界,ymin=0
那么您会得到。
\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}