我使用了 但是这对红色箭头没有效果。
% \usetikzlibrary{bending}
>={Stealth[length=3.5pt, width=2pt, inset=1pt, bend]}
我可以做些什么来“弯曲/倾斜”红色箭头?
\documentclass[margin=5pt, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{bending}
\begin{document}
\begin{tikzpicture}[x=1em, y=1em,
>={Stealth[length=3.5pt, width=2pt, inset=1pt, bend]},
No/.style={->, thin, font=\sffamily\tiny, blue, inner sep=0.5pt, very near start},
]
\draw[No] (140:1.2) -- +(0.6,0.05) node[No, above]{1};
\draw[No] (163:0.9) -- +(0.6,0.05) node[No, above]{2};
\draw[No, red, rounded corners=3] (200:0.6) -- ++(-0.3,-0.3) -- ++(0.3,-0.3) node[below]{bad};
\end{tikzpicture}
\end{document}
答案1
我同意圆角似乎被忽略了bending
。这是因为弯曲的工作原理。1要理解这一点,请查看以下部分的讨论TikZ 库弯曲在 pgfmanual v3.1.5 第 204 页,以及第TikZ 库曲线在第 1165 页。但是,您可以构造一条与其非常相似的平滑路径。
\documentclass[margin=5pt, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{bending}
\begin{document}
\begin{tikzpicture}[x=1em, y=1em,
>={Stealth[length=3.5pt, width=2pt, inset=1pt, bend]},
No/.style={->, thin, font=\sffamily\tiny, blue, inner sep=0.5pt, very near start},
]
\draw[No] (140:1.2) -- +(0.6,0.05) node[No, above]{1};
\draw[No] (163:0.9) -- +(0.6,0.05) node[No, above]{2};
\path (200:0.6) coordinate (p1) -- ++(-0.3,-0.3) coordinate (p2)
-- ++(0.3,-0.3) coordinate (p3);
\draw[No, red] plot[smooth,samples at={1,2,3},tension=1.6] (p\x)
node[below]{not bad};
\end{tikzpicture}
\end{document}
1这是不是与我们无法访问粗曲线轮廓的事实相似。后者是因为粗线是用查看器绘制的,即通过特殊绘制的。我们可以完美地访问装饰和交叉点中带圆角的路径的坐标。关键是圆角不支持弯曲。