以下代码在圆圈中心生成了一个箭头。有人能解释一下为什么以及如何删除它吗?
\tikzset{pics/carc/.style args={#1:#2:#3}{
code={\draw[pic actions] (#1:#3) arc(#1:#2:#3);
}}}
\begin{tikzpicture}
\draw[<-,>=stealth', thick, black] (0,0) pic{carc=100:440:1.6};
\draw[<-,>=stealth', thick, black] (0,0) pic{carc=100:440:1.1};
\draw[<-,>=stealth', thick, black] (0,0) pic{carc=100:440:0.6};
\end{tikzpicture}
答案1
替换\draw
为,\path
则指向 的箭头(0,0)
(即路径的终点)将不会被绘制:
\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\tikzset{pics/carc/.style args={#1:#2:#3}{
code={\draw[pic actions] (#1:#3) arc(#1:#2:#3);
}}}
\begin{tikzpicture}
\path[<-,>=stealth', thick, black]
(0,0) foreach \r in {1.6,1.1,.6}{pic {carc=100:440:\r}};
\end{tikzpicture}
\end{document}
答案2
箭头在那里是因为你问了 Ti钾用 Z 来表达。我猜你想将选项传递到\draw
图片内部,而不是外部。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\tikzset{pics/carc/.style args={#1:#2:#3}{
code={\draw[pic actions] (#1:#3) arc(#1:#2:#3);
}}}
\begin{tikzpicture}
\draw (0,0) pic[<-,>=stealth', thick, black]{carc=100:440:1.6};
\draw (0,0) pic[<-,>=stealth', thick, black]{carc=100:440:1.1};
\draw (0,0) pic[<-,>=stealth', thick, black]{carc=100:440:0.6};
\end{tikzpicture}
\end{document}