消失圖(所有值已被過濾掉)

消失圖(所有值已被過濾掉)

我正在嘗試讓以下情節發揮作用

\documentclass[a4paper,10pt]{standalone}
\usepackage{pgfplots,tikz}
\pgfplotsset{compat=1.6}
\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}[%
scale only axis,
xmin=0, xmax=14,
xlabel={Iterations},
ymin=-0.747366157054232, ymax=-0.627152206833444,
yminorticks=true,
ylabel={Values $g(x)$}
]
\addplot [
color=blue,
solid
]
table{
1 -0.627152206833444
2 -0.727653418778865
3 -0.744147940956529
4 -0.74683810473197
5 -0.747279463520111
6 -0.747351895087422
7 -0.747363807639291
8 -0.747365769422513
9 -0.747366093009514
10 -0.747366146462357
11 -0.747366155305526
12 -0.747366156770711
13 -0.747366157013831
14 -0.747366157054232
};
\end{semilogyaxis}
\end{tikzpicture}%
\end{document}

問題是我收到錯誤訊息

!套件 pgfplots 警告:目前繪圖沒有座標(或全部已被過濾掉)

我認為這與非常接近的值和對數尺度的組合有關。 (該圖使用法線軸編譯得很好)

有什麼方法可以讓劇情發揮作用對數刻度? ' 西北

答案1

發生這種情況是因為圖中只有負 y 值,並且沒有為負值定義對數。您可以反轉資料的符號以使對數圖起作用,但使用此資料集,該圖不會變得更清晰(漸近線附近的值只會被推得更近)。

相關內容