.png)
境界四角形の左/右座標に基づいてノードを配置する方法はありますか? 中央の位置しか指定できないようです。
答え1
特定の座標でノードを左揃えまたは右揃えにしたい場合は、ノードのanchor = east
/オプションを使用します。中央揃え、右揃え、左揃えの例を次に示します。anchor=west
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[framed]
\useasboundingbox (0,0) rectangle (4,4);
\node at (2,2) {gnarply};
\draw (2,2)--(3,3);
\end{tikzpicture}\qquad
\begin{tikzpicture}[framed]
\useasboundingbox (0,0) rectangle (4,4);
\node[anchor=west] at (2,2) {gnarply};
\draw (2,2)--(3,3);
\end{tikzpicture}\qquad
\begin{tikzpicture}[framed]
\useasboundingbox (0,0) rectangle (4,4);
\node[anchor=east] at (2,2) {gnarply};
\draw (2,2)--(3,3);
\end{tikzpicture}
\end{document}