在两个节点之间放置锚点

在两个节点之间放置锚点

我正在使用tikzpicture绘制下一个图像:

在此处输入图片描述

\begin{figure}[htbp]
    \centering
        \begin{tikzpicture}
        \draw[thick,->] (0,0) -- (6,0) node[anchor=north west] {x};
        \draw[thick,->] (0,0) -- (0,6) node[anchor=south east] {y};       
        \fill (0.5,0.5)  circle[radius=2pt]node[anchor=north west] {M};
        \fill (5,4)  circle[radius=2pt]node[anchor=north west] {T};
        \fill (6,5)  circle[radius=2pt]node[anchor=north west] {$D_{1}$};
        \fill (4,3)  circle[radius=2pt]node[anchor=north west] {$D_{2}$};
        \draw[thick,->] (0.5,0.5) -- (1,1) node[anchor=north west] {$V_{M}$};
        \draw[thick,->] (6,5) -- (5.5,5.5) node[anchor=north east] {$V_{T}$};
        \draw[thick,->] (4,3) -- (3.5,3.5) node[anchor=north east] {$V_{T}$};
        \draw[dashed,<->] (4,0.5) -- (4,2.9) node[-1cm] {$y_{T_{1}}$};
        \draw[dashed,<->] (5,0.5) -- (5,3.9) node[anchor=south east] {$y_{cent}$};
        \draw[dashed,<->] (6,0.5) -- (6,4.9) node[anchor=south east] {$y_{T_{2}}$};
        \draw [dashed] (0.5,0.5) -- (6,0.5);
        \draw (6.414235,4) arc (0:360:1.414213);
        \end{tikzpicture}
\end{figure}

我希望中间线(y_{cent})的文本出现在红色圆圈的位置,而不是虚线箭头的顶部。

答案1

我会像这样画,也许是改进的版本,具有更好的标签定位。

    \begin{tikzpicture}
    \draw[thick,->] (0,0) -- (6,0) node[anchor=north east] {$x$};
    \draw[thick,->] (0,0) -- (0,6) node[anchor=north east] {$y$};       
    \fill (0.5,0.5)  circle[radius=2pt]node[anchor=north] {$M$};
    \fill (5,4)  circle[radius=2pt]node[anchor=west] {$T$};
    \fill (6,5)  circle[radius=2pt]node[anchor=south west] {$D_{1}$};
    \fill (4,3)  circle[radius=2pt]node[anchor=north east] {$D_{2}$};
    \draw[thick,->] (0.5,0.5) -- (1,1) node[anchor=south] {$V_{M}$};
    \draw[thick,->] (6,5) -- (5.5,5.5) node[anchor=south] {$V_{T}$};
    \draw[thick,->] (4,3) -- (3.5,3.5) node[anchor=east] {$V_{T}$};
    \draw[dashed,<->] (4,0.5) -- (4,2.9) node[anchor=south west] {$y_{T_{1}}$};
    \draw[dashed,<->] (5,0.5) --node[anchor=center,fill=white] {$y_{\text{cent}}$} (5,3.9) ;
    \draw[dashed,<->] (6,0.5) -- (6,4.9) node[anchor=east] {$y_{T_{2}}$};
    \draw [dashed] (0.5,0.5) -- (6,0.5);
    \draw (5,4) circle (1.41cm);
    \end{tikzpicture}

在此处输入图片描述

答案2

我会按如下方式绘制你的图像:

在此处输入图片描述

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{quotes}

\begin{document}
\begin{tikzpicture}[auto=right,
dot/.style = {circle, inner sep=1pt, fill}
                    ]
\draw[thick,->] (0,0) -- (6,0) node[below left] {x};
\draw[thick,->] (0,0) -- (0,6) node[below left] {y};
%
\node[dot, label=below:$M$] at (0.5,0.5)    {};
\node[dot, label=right:$T$] at (5,4)        {};
\node[dot, label=right:$D_{1}$] at (6,5)    {};
\node[dot, label=right:$D_{2}$] at (4,3)    {};
%
\draw[thick,->] (0.5,0.5) -- (1,1) node[right] {$V_{M}$};
\draw[thick,->] (6,5) -- (5.5,5.5) node[above right] {$V_{T}$};
\draw[thick,->] (4,3) -- (3.5,3.5) node[below left] {$V_{T}$};
\draw[dashed,<->] (4,0.5) to ["$y_{T_{1}}^{}$"]     (4,2.9);
\draw[dashed,<->] (5,0.5) to ["$y_\mathrm{cent}$"]  (5,3.9);
\draw[dashed,<->] (6,0.5) to ["$y_{T_{2}}^{}$"]     (6,4.9);
\draw [dashed] (0.5,0.5) -- (6,0.5);
\draw (5,4) circle (1.414213);
\end{tikzpicture}
\end{document}

相关内容