ファイルからいくつかの座標を読み取り、TikZ を使用してそれらを描画しようとしています。ファイルの形式は次のとおりです。
timestamp 1.002132 3.2131231
timestamp 1.332132 2.9120
これは私が持っているコードです:
\begin{tikzpicture}
\draw[step=0.5,black,thin,xshift=0cm,yshift=0cm, opacity=0.3] (0,0) grid (8,4);
\draw [->](-.5,.5) -- (8.5,.5);
\draw [->] (4, -.5) -- (4, 4.5);
% read file and draw coordinates
\newread\file
\openin\file=recording2
\loop
\read\file to\fileline
\unless\ifeof\file
% Fetch coordinates in \coordX and \coordY
\StrSplit{\fileline}{14}{\ts}{\coords}
\def\coordX{\StrBefore{\coords}{ }}
\def\coordY{\StrBehind{\coords}{ }}
\draw (1,1) node {\coordX}; %this works fine
\draw (1,1) node {\coordY}; %this works fine
\draw (\coordX+4,\coordY+0.5) circle(1pt); %this cause the error
\repeat
\closein\file
\end{tikzpicture}
coordX と coordY の両方の値を出力しましたが、それらは正しいです。エラーの原因は何か分かりますか? TikZ が値を数値として解釈するには、値を「キャスト」する必要がありますか?
LaTeX のメモリ設定を編集してみましたが、運が悪かったので、エラーはコードにあると思います (duh-uh)。