交差矢印のある図

交差矢印のある図

私の問題は、図の中に交差する線や矢印があり、検索中に次のような答えを見つけたことです。ここ私の問題には適していません。誰かこれを手伝ってくれるかもしれません。企業から政府への矢印は、CB と銀行の間の矢印と交差する必要がありますが、テキストが読めるようにする必要があります。矢印を別のレイヤーなどに配置することは可能ですか?

\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=3.5em,
           text centered}
}


\begin{tikzpicture}[node distance=1cm, auto, description/.style={fill=white,inner sep=2pt}]

 %nodes
 \node[punkt]                      (Banks)  {Banks ($B_b$)};
 \node[left=4cm of Banks]          (dummy1) {};
 \node[right=4cm of Banks]         (dummy2) {};
 \node[punkt, above=4cm of dummy1] (CB)     {CB};
 \node[punkt, below=4cm of dummy1] (Gov)    {Government};
 \node[punkt, above=4cm of dummy2] (Firms)  {Firms ($F_f$)};
 \node[punkt, below=4cm of dummy2] (HH)     {HH ($HH_{hh}$)};


\path[->, >=latex, thick]
  (Gov.20)      edge[] node[below, rotate=48]  {\small Bonds}                       (Banks.220)
  (Banks.200)   edge[] node[above, rotate=48]  {\small Deposits}                    (Gov.40)
  (Firms.250)   edge[] node[above, rotate=90]  {\small wage, dividends}             (HH.110)
  (HH.70)       edge[] node[below, rotate=90]  {\small equity, consumption}         (Firms.290)
  (Gov.350)     edge[] node[below]             {\small unempl. benefit}             (HH.190)
  (HH.170)      edge[] node[above]             {\small Taxes}                       (Gov.10)
  (CB.325)      edge[] node[below, rotate=-50] {\small interest, OSDF}              (Banks.160)
  (Banks.143)   edge[] node[above, rotate=-50] {\small interest, IDL, OMO, OSLF}    (CB.345)
  (Firms.200)   edge[] node[above, rotate=48]  {\small principal/interest payments} (Banks.40)
  (Banks.20)    edge[] node[below, rotate=48]  {\small Loans, interest}             (Firms.220)
  (HH.143)      edge[] node[above, rotate=-50]  {\small equity}                     (Banks.345)
  (Banks.325)   edge[] node[below, rotate=-50]  {\small interest, dividends}        (HH.160)
  (Banks.west)  edge[out=200, in=340, looseness=5] node[below]  {\small interbank loans} (Banks.east)
  (Firms.170)   edge[bend right=35]                node[above, near end, rotate=60]  {\small Taxes}               (Gov.120);
\end{tikzpicture}

ここに画像の説明を入力してください

答え1

私はシンプルな解決策を支持します: (1) 交差するエッジを描画する、(2) 背景に溶け込むように半透明の白い四角形を描画する、(3) その上に他のものを描画する。

\path[->, >=latex, thick](Firms.170)   edge[bend right=35]   node[above, near end, rotate=60]  {\small Taxes}               (Gov.120);

\path[fill=white, opacity=0.8] (-3.2,1) rectangle +(1.5,2);

\path[->, >=latex, thick]
  (Gov.20)      edge[] node[below, rotate=48]  {\small Bonds}                            (Banks.220)
[...]
  (Banks.west)  edge[out=200, in=340, looseness=5] node[below]  {\small interbank loans} (Banks.east);

ここに画像の説明を入力してください

答え2

レイヤーを使用した別のアプローチbackground:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\usetikzlibrary{backgrounds}     %new code
\tikzset{
    %Define standard arrow tip
    >=stealth,
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=3.5em,
           text centered}
}

\begin{document}
\begin{tikzpicture}[node distance=1cm, auto, description/.style={fill=white,inner sep=2pt}]

 %nodes
 \node[punkt]                      (Banks)  {Banks ($B_b$)};
 \node[left=4cm of Banks]          (dummy1) {};
 \node[right=4cm of Banks]         (dummy2) {};
 \node[punkt, above=4cm of dummy1] (CB)     {CB};
 \node[punkt, below=4cm of dummy1] (Gov)    {Government};
 \node[punkt, above=4cm of dummy2] (Firms)  {Firms ($F_f$)};
 \node[punkt, below=4cm of dummy2] (HH)     {HH ($HH_{hh}$)};


\path[->, >=latex, thick]
  (Gov.20)      edge[] node[below, rotate=48]  {\small Bonds}                       (Banks.220)
  (Banks.200)   edge[] node[above, rotate=48]  {\small Deposits}                    (Gov.40)
  (Firms.250)   edge[] node[above, rotate=90]  {\small wage, dividends}             (HH.110)
  (HH.70)       edge[] node[below, rotate=90]  {\small equity, consumption}         (Firms.290)
  (Gov.350)     edge[] node[below]             {\small unempl. benefit}             (HH.190)
  (HH.170)      edge[] node[above]             {\small Taxes}                       (Gov.10)
  (CB.325)      edge[] node[fill=white,below, sloped] {\small interest, OSDF}              (Banks.160)     %new code
  (Banks.143)   edge[] node[fill=white,above, sloped] {\small interest, IDL, OMO, OSLF}    (CB.345)        %new code
  (Firms.200)   edge[] node[above, rotate=48]  {\small principal/interest payments} (Banks.40)
  (Banks.20)    edge[] node[below, rotate=48]  {\small Loans, interest}             (Firms.220)
  (HH.143)      edge[] node[above, rotate=-50]  {\small equity}                     (Banks.345)
  (Banks.325)   edge[] node[below, rotate=-50]  {\small interest, dividends}        (HH.160)
  (Banks.west)  edge[out=200, in=340, looseness=5] node[below]  {\small interbank loans} (Banks.east);

\begin{scope}[on background layer]   %new code
   \path[->, >=latex, thick]  (Firms.170)   edge[bend right=35]                node[above, near end, rotate=60]  {\small Taxes}               (Gov.120);
\end{scope}
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

スコープパスはメインパスの後ろになります

関連情報