![如何在 TikZ 中将特定形状的节点放置在一条线上](https://linux22.com/image/281839/%E5%A6%82%E4%BD%95%E5%9C%A8%20TikZ%20%E4%B8%AD%E5%B0%86%E7%89%B9%E5%AE%9A%E5%BD%A2%E7%8A%B6%E7%9A%84%E8%8A%82%E7%82%B9%E6%94%BE%E7%BD%AE%E5%9C%A8%E4%B8%80%E6%9D%A1%E7%BA%BF%E4%B8%8A.png)
我想要一个箭头形的节点,其尾部位于我的参考框架的垂直轴上。
我得到了:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw [->] (-2.5,0) -- (2.5,0) node [below] {$\theta$};
\draw [->] (0,-.5) -- (0,3) node [left] {$f$};
\draw [->,thick] (1.5,0) node [below] {$t$} -- (1.5,1.5);
\node [single arrow,draw=none,fill=black!20] at (0,2) {\tiny{\texttt{Integration interval}}};
\end{tikzpicture}
\end{figure}
\end{document}
答案1
使用选项将默认锚点位置(center
)更改为west
node
\node[anchor=west,single arrow,draw=none,fill=black!20]%
at (0,2) {\tiny{\texttt{Integration interval}}} ;