
対数プロットに 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
残念ながらpgfプロット描画スキーム( )を呼び出す前に、範囲外の座標を自動的に削除します/pgfplots/error bars/draw error bar/
。pgfプロットエラーバーのその部分の描画を再検討します。
それでも、誇張したマークが付いた 2 番目のプロットを作成することで、エラーバーを強調することができます。次の点を考慮してください。
\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}