我想在一个圆圈周围画一个实心箭头。到目前为止,我的图片是
我需要在上图中绿色曲线的末端添加提示。我希望能够为两侧添加提示。我该怎么做?
\documentclass[]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,fit,arrows, positioning}
\usepackage{graphicx}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[auto,node distance=3cm,>=stealth']
\coordinate (O) at (5,0);
\draw [very thick,fill=blue,fill opacity=.1]
( 5, 0) circle (2.0cm) node [opacity=1] {B} ;
\draw[fill=green]
($(O) + (0:23mm)$) arc (0:180:23mm) -- ($(O) + (180:24mm)$) arc (180:0:24mm) -- cycle;
\end{tikzpicture}
\end{document}
答案1
像这样吗?
\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{calc,arrows.meta}
\begin{document}
\begin{tikzpicture}[auto,node distance=3cm,>={Stealth[width=4mm, length=6mm, fill=green]}]
\coordinate (O) at (5,0);
\draw [very thick,fill=blue,fill opacity=.1]
( 5, 0) circle (2.0cm) node [opacity=1] {B} ;
\draw[double=green, double distance=1mm, <->]
($(O) + (0:23.5mm)$) arc (0:180:23.5mm);
\end{tikzpicture}
\end{document}
编辑
如果您使用的是旧版本的 TiKZ,则上述操作将不起作用。在这种情况下,您应该更新 TeX 发行版(推荐),或者,如果您无法做到这一点,请尝试以下操作:
\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{calc,arrows}
\begin{document}
\begin{tikzpicture}[auto,node distance=3cm,>=stealth']
\coordinate (O) at (5,0);
\draw [very thick,fill=blue,fill opacity=.1]
( 5, 0) circle (2.0cm) node [opacity=1] {B} ;
\draw[double=green, double distance=1mm, <->, green]
($(O) + (0:23.5mm)$) arc (0:180:23.5mm);
\end{tikzpicture}
\end{document}
答案2
这是解决方案(使用我的答案使用 TikZ 的两种颜色的箭头):
\documentclass[margin=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,arrows}
\tikzset{
double arrows/.style args={#1 colored by #2 and #3}{
>=stealth,
<->,line width=#1,#2, % first arrow
postaction={draw,<->,#3,line width=(#1)/3,
shorten <=2*(#1)/3,shorten >=2*(#1)/3}, % second arrow
}
}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (5,0);
\draw [very thick,fill=blue,fill opacity=.1]
(O) circle (2.0cm) node [opacity=1] {B} ;
\draw[double arrows=1.5mm colored by black and green]
($(O) + (0:23mm)$) ++(0,-1.5mm) -- ++(0,1.5mm) arc (0:180:23mm) -- ++(0,-1.5mm);
\end{tikzpicture}%
\end{document}