
代碼 :
\documentclass{book}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw (-3,0)--(3,0) node [below] {\scriptsize $\Omega$} ;
\draw (0,0) node[below]{0} node [below=3mm]{(a)}--(0,3) node[right]{\scriptsize $X_s(j\Omega)$};
\draw [-latex](2,0) node [below, rotate=-90] {\scriptsize $16000\pi$} --(2,1.5) node [right]{$\frac{\pi}{T}$};
\end{tikzpicture}
\end{figure}
\end{document}
嘗試將垂直文字直接放置在垂直線下方。文字稍微向左顯示,其中心與行底部對齊。如何將垂直文字直接放置在垂直線下方?
答案1
west
在這種情況下,您需要選擇合適的錨點。
\documentclass{book}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[nodes={font=\scriptsize}]
\draw (-3,0)--(3,0) node [below] {$\Omega$} ;
\draw (0,0) node[below]{0} node [below=3mm]{(a)}--(0,3) node[right]{$X_s(j\Omega)$};
\draw [-latex](2,0) node [ rotate=-90,anchor=west] {$16000\pi$} --(2,1.5) node [right]{$\frac{\pi}{T}$};
\end{tikzpicture}
\end{figure}
\end{document}
另請注意,使用font=\scriptsize
而不是放入\scriptsize
節點內容是有利的,如果您想將其應用於所有節點,請使用nodes={font=\scriptsize}
。