我想在我的图中添加水平辅助线,而不是网格。所以我决定用 \draw[very thin] 添加线条,但不知何故这些线条彼此不同。我希望它们都一样。我希望有人能帮助我。我正在使用 dataplot 包加载 *.csv 文件并绘制图。
这就是我的代码
\DTLloaddb{kiting}{Abbildungen/Kapitel_05/kitingplot.csv}
\DTLloaddb{kitingdxcs}{Abbildungen/Kapitel_05/kitingdxcsplot.csv}
\begin{figure}[htpb]
\centering
\setcounter{DTLplotroundXvar}{0}
\renewcommand*{\DTLplotatendtikz}{%
\draw[very thin, gray] (0,60) -- (1000,60);
\draw[very thin, gray] (0,65) -- (1000,65);
\draw[very thin, gray] (0,70) -- (1000,70);
\draw[very thin, gray] (0,75) -- (1000,75);
\draw[very thin, gray] (0,80) -- (1000,80);
\draw[very thin, gray] (0,85) -- (1000,85);
\draw[very thin, gray] (0,90) -- (1000,90);
\draw[very thin, gray] (0,95) -- (1000,95);
\draw[very thin, gray,] (0,100) -- (1000,100);
}
\DTLplot{kiting,kitingdxcs}{x=Spiele, y=Siege, style=lines, linecolors={red, blue}, bounds={0, 40, 1000, 100}, xlabel={Spiele}, ylabel={Gewonnene Spiele in \%}, legend=south, legendlabels={Kiting, Kiting DXCS}, height = 3in, yticgap=5}
\caption{Kiting Experiment}
\end{figure}
答案1
\begin{tikzpicture}[scale=1.0]
\begin{axis}[ ymajorgrids=true]%THIS WILL DRAW THE HORIZONTAL LINES
\addplot table [col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}