如何在 pgfplots 中的向量底部繪製弧?

如何在 pgfplots 中的向量底部繪製弧?

我想使用 pgfplots 表示一組 5 個向量,其底部帶有扇區,如下圖所示。在此輸入影像描述

答案1

這是一個普通的鈦kZ 方式。

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[pics/wedge arrow/.style={code={
\tikzset{wedge arrow/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/wedge arrow/##1}} 
 \draw[dashed,thick,fill=\pv{fill},fill opacity=0.5]
  (0,0) -- (\pv{alpha}-\pv{beta}/2:\pv{r}*\pv{R})
  arc[start angle=\pv{alpha}-\pv{beta}/2,end angle=\pv{alpha}+\pv{beta}/2,
    radius=\pv{r}*\pv{R}] -- cycle;
 \draw[-latex,thick,blue] (0,0) -- (\pv{alpha}:\pv{R});
 \fill (\pv{alpha}:\pv{R}) circle[radius=2pt];
}},wedge arrow/.cd,alpha/.initial=90,beta/.initial=60,
    R/.initial=2cm,r/.initial=0.5,fill/.initial=gray!30]
\path pic {wedge arrow={alpha=15,r=0.4}}
 pic {wedge arrow={alpha=40,beta=50,r=0.6}}
 pic {wedge arrow={alpha=65,beta=60,r=0.5}};
\end{tikzpicture}
\end{document}

在此輸入影像描述

圖片wedge arrow接受幾個參數:箭頭的角度alpha、楔子的張角 、beta半徑以及楔子的半徑與,R之間的比率。Rr

相關內容