沿着线绘制垂直线作为节点

沿着线绘制垂直线作为节点

我创建了以下 Tikzpicutre:

在此处输入图片描述

\begin{tikzpicture}
    \node (Borrow) at (-3, 9) {$b < 0$};
    \node (Lend) at (3, 9) {$b > 0$};
    \node (Top) at (0, 11) {$i^{dw}$};
    \node (Bottom) at (0, 7) {$i^m$};
    \draw[|-|] (Top) -- (Bottom) node[pos =0.6, right] (Funds) {$i^{ff}, \Lambda$}
    node[pos =0.2, right] (AverageBorrowing) {$\chi^{-}$}
    node[pos =0.8, right] (AverageLending) {$\chi^{+}$};
    \draw[->] (Borrow) -- (Top) node[pos = 0.66, above] (DW)  {$1-\varphi^{-}$};
    \draw[->] (Borrow) -- (Funds) node[pos = 0.66, above] (BFunds)  {$\varphi^{-}$};
    \draw[->] (Lend) -- (Bottom) node[pos = 0.3, below] (Overnight)  {$1-\varphi^{+}$};
     \draw[->] (Lend) -- (Funds) node[pos = 0.3, above] (LFunds)  {$\varphi^{+}$};
\end{tikzpicture}

我在顶部(注释为 i^dw)和底部(注释为 i^m)之间的垂直线上创建了三个节点。我想更改图片的两个元素:

  • 我不想将这些节点的文本对齐在右侧,而是希望将其对齐在东北方向(右上)。
  • 三个节点上应该有一条水平线穿过顶部和底部节点之间的线。指向中间节点(资金)的箭头应该指向垂直线而不是文本。

有人能建议一下如何实现这两项改变吗?

答案1

我不确定我是否理解了您的所有描述。我认为您希望垂直线上附加的节点文本与右上对齐。可以使用 来实现anchor=south west。但是,然后您想使用线上的定位来附加箭头和垂直线,因此我认为使用尽可能小的节点并使用labelti 设置其外部的文本更容易。然后我以这样的方式结束。

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \node (Borrow) at (-3, 9) {$b < 0$};
    \node (Lend) at (3, 9) {$b > 0$};
    \node (Top) at (0, 11) {$i^{dw}$};
    \node (Bottom) at (0, 7) {$i^m$};
    \draw[|-|] (Top) -- (Bottom) node[pos =0.6,label=45:{$i^{ff},\Lambda$},inner sep=0pt] (Funds) {}
    node[pos =0.2,inner sep=0pt,label=45:{$\chi^{-}$}] (AverageBorrowing) {}
    node[pos =0.8,inner sep=0pt,label=45:{$\chi^{+}$}] (AverageLending) {};
    \draw[->] (Borrow) -- (Top) node[pos = 0.66, above] (DW)  {$1-\varphi^{-}$};
    \draw[->] (Borrow) -- (Funds.center) node[pos = 0.66, above] (BFunds)  {$\varphi^{-}$};
    \draw[->] (Lend) -- (Bottom) node[pos = 0.3, below] (Overnight)  {$1-\varphi^{+}$};
    \draw[->] (Lend) -- (Funds.center) node[pos = 0.3, above] (LFunds)  {$\varphi^{+}$};
    %%
    \draw[dashed, red] ([xshift=-1cm]AverageBorrowing.center) -- +(2cm,0cm);
    \draw[dashed, red] ([xshift=-1cm]Funds.center) -- +(2cm,0cm);
    \draw[dashed, red] ([xshift=-1cm]AverageLending.center) -- +(2cm,0cm);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容