使用以下代码,可以将红色箭头及其文本插入蓝线 pos=.5(蓝色圆圈旁边)的节点内,而不是使用绘制命令单独绘制
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows, arrows.meta, positioning, calc, intersections, decorations.pathreplacing, decorations.pathmorphing, decorations.markings, shapes, shapes.misc, shapes.symbols, shapes.geometric, patterns}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw [thick,-latex](0,0) -- (4,0) node [black, xshift=.93cm, yshift=0cm] {$Q$};
\draw [thick,-latex](0,0) -- (0,8) node [black, xshift=0cm, yshift=.3cm] {$P$};
\draw [ultra thick,blue] (0,7.5) -- +(-50:5cm) node [pos=.5, circle, draw, blue, fill=blue, scale=0.4]{};
\draw [thick,red,-latex'] (2.08,5.92) node [red, xshift=.2cm, yshift=.04cm]{x} -- +(-140:.4cm);
\end{tikzpicture}
\end{frame}
\end{document}
答案1
普通引脚可以在 pgfmanual 第 241 页找到。
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{arrows}
%\usetikzlibrary{arrows, arrows.meta, positioning, calc, intersections, decorations.pathreplacing, decorations.pathmorphing, decorations.markings, shapes, shapes.misc, shapes.symbols, shapes.geometric, patterns}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw [thick,-latex](0,0) -- (4,0) node [black, xshift=.93cm, yshift=0cm] {$Q$};
\draw [thick,-latex](0,0) -- (0,8) node [black, xshift=0cm, yshift=.3cm] {$P$};
\draw [ultra thick,blue] (0,7.5) -- +(-50:5cm) node [pos=.5, circle, draw, blue,
fill=blue, scale=0.4,pin={[red,pin edge={red,thick,latex'-}]above right:x}]{};
\end{tikzpicture}
\end{frame}
\end{document}