
画像の円で示されているように、0そして境界線。その小さな隙間をどうやって取り除くことができるでしょうか?
ムウェ
上記のプロットを生成するサンプルコード
% in preamble
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
x,y
0.01,0.9583333333
0.02,0.8125
%...100 in total...
\end{filecontents*}
% in document
\begin{figure}[t]
\begin{tikzpicture}
\pgfplotsset{legend style={font=\tiny}}
\begin{axis}[
xlabel={Recall},
xtick={0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
ylabel={Precision},
ytick={0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
legend cell align=left,
legend pos=north east]
\addplot[c1, thin, mark=square, mark repeat=5] table[x=x, y=y, col sep=comma] {data.csv};
\addlegendentry{x-y};
\end{axis}
\end{tikzpicture}
\caption{plot}\label{fig:plot}
\end{figure}
アップデート:
これは私がMatlabを使って期待していたものです。左下隅に1つあります。0x 軸と y 軸の両方で共有されるラベル。
答え1
コメント内のいくつかの提案が解決につながりました。
デフォルトでは、pgfplots
プロット データに基づいて軸の制限を自動的に検出すると、プロット ビューポートがわずかに拡大されます。 キー設定enlargelimits=false
またはをenlarge x limits=false
使用すると、それぞれすべての軸または個々の軸に対してこれを防ぐことができます。
ただし、この場合、プロットされたデータの範囲は、目的の軸の制限と一致しません。ここで、軸の制限 (xmin=0
など) を明示的に設定すると、目的の結果が得られます。
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
x,y
0.01,0.9583333333
0.02,0.8125
%...100 in total...
0.99,0.1875
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
enlarge x limits=false,
xlabel={Recall},
xmin=0,xmax=1,
xtick={0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
ylabel={Precision},
ymin=0.1,ymax=1,
ytick={0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
]
\addplot table[x=x, y=y, col sep=comma] {data.csv};
\addlegendentry{x-y};
\end{axis}
\end{tikzpicture}
\end{document}