
로그 플롯에 95% 신뢰 구간을 나타내는 오차 막대가 있습니다. 일부 오류 막대는 로그가 정의되지 않은 음수로 확장되므로 pgfplots는 막대를 완전히 삭제합니다. 대신 축까지 완전히 확장되는 점선과 같은 플롯을 만들 수 있는 방법이 있습니까?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}
\addplot [error bars/.cd, y dir=both, y explicit] coordinates {
(1, 10) +- (0, 1)
(2, 10) +- (0, 10)
(3, 10) +- (0, 1)
};
\end{semilogyaxis}
\end{tikzpicture}
\end{document}
답변1
안타깝게도pgfplots에서는 그리기 구성표( )를 호출하기 전에 범위를 벗어난 좌표를 자동으로 삭제합니다 /pgfplots/error bars/draw error bar/
. 그럴 가능성은 (거의) 없다.pgfplots오류 표시줄의 해당 부분을 그리는 것을 다시 고려하겠습니다.
그럼에도 불구하고 과장된 표시가 있는 두 번째 플롯을 만들어 오류 막대를 강조할 수 있습니다. 다음을 고려하세요:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}
\addplot [error bars/.cd, y dir=both, y explicit] coordinates {
(1, 9) +- (0, 1) % good point
(2, 11) += (0, 10) % bad point
(3, 10) +- (0, 1) % good poiny
(4, 12) -= (0,3) % bad point
};
\addplot [only marks,mark=.,error bars/.cd, y dir=both, y explicit relative,error mark=triangle*, error mark options={rotate=-90,scale=4}] coordinates {
% good point has nothing to do
(2, 11) -= (0,.5) % bad point
% good point has nothing to do
(4, 12) += (0,.5) % bad point
};
\end{semilogyaxis}
\end{tikzpicture}
\end{document}