Polaraxis 플롯의 오차 막대

Polaraxis 플롯의 오차 막대

y 데이터 포인트에 대한 오류 막대가 있는 극축 플롯을 만들려고 합니다. error bars/.cd축 플롯과 비슷한 방식 으로 시도했지만 결과가 매우 지저분해졌습니다. 문맥상 x 데이터는 각도이고 y 데이터는 반지름입니다.

현재 결과

pgfplots에서 다른 방법을 찾을 수 없습니다. 아니면 제가 뭔가 잘못하고 있는 걸까요? 내 코드는 다음과 같습니다

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat = newest, error bars/y explicit}
\usepgfplotslibrary{polar}

\begin{document}

\begin{tikzpicture}
\begin{polaraxis}
[
    /pgf/number format/use comma,
    xmin = 0, xmax = 360,
    ymin = 30, ymax = 110,
    grid = both,
    major grid style = gray!60,
    minor grid style = gray!10,
    minor tick num = 3,
    yticklabel style = {yshift = -4.65cm},
    y axis line style = {yshift = -4.77cm},
    ytick style = {yshift = -4.77cm},
    legend cell align = left,
    legend style = {at = {(0.25,-0.22)}} 
]
% Adding plot from data
\addplot+
[
    blue!70!yellow,
    only marks,
    mark = square*,
    mark options = {fill = blue!70!yellow},
    mark size = 0.75pt,
    error bars/.cd,
    y dir = both
]           
    coordinates{ (0.0, 91.32)   +-  (0, 2.58)
                    (15.0, 91.83)   +-  (0, 2.61)
                    (30.0, 90.90)   +-  (0, 2.55)
                    (45.0, 90.56)   +-  (0, 2.53)
                    (60.0, 90.98)   +-  (0, 2.56)
                    (75.0, 90.98)   +-  (0, 2.51)
                    (90.0, 91.06)   +-  (0, 2.56)
                   };

\end{polaraxis}
\end{tikzpicture}

\end{document}

답변1

다음과 같이 떨림 플롯을 사용할 수 있습니다.

\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{pgfplotstable}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}
\pgfplotstableread{
x y e
60.0 85 3
55.0 88 3
50.0 90 5 
55.0 96 3
65.0 94 3
86.0 91 3
}\loadedtable %data changed
\begin{polaraxis}[
xmin=0, xmax=360,
ymin=30, ymax=110,
grid=both,
grid style=gray!20,
]
\addplot[
blue,
forget plot,
quiver={u=0,v=2*\thisrow{e}},
|-|,
] table[y expr={\thisrow{y}-\thisrow{e}}]{\loadedtable};

\addplot+[
only marks,
mark size=0.75pt,
] table{\loadedtable};
\node[align=left, font=\tiny] at (82,80) {I can't\\shake him!};
\end{polaraxis}
\end{tikzpicture}
\end{document}

방사형 오차 막대가 있는 극좌표

관련 정보