如何将 tikzpicture 嵌入 tikzpicture 中?

如何将 tikzpicture 嵌入 tikzpicture 中?

我想嵌入以下情节:

在此处输入图片描述

在此备份图中我写了“hi”的地方:

在此处输入图片描述

期望结果:

在此处输入图片描述

您知道有什么方法可以用 Tikz 来实现这一点吗?谢谢,非常感谢您的帮助。

编辑: 以下是我到目前为止拼凑起来的内容,我使用了该intersections库:

% Tree like backup diagram
\tikzset{
state_node/.style={circle, draw=black, scale=1.2},
action_node/.style={circle, fill=black, scale=0.68},
}

\begin{figure}
\begin{tikzpicture}[level/.style={sibling distance=18mm/#1}]
\node[action_node] (a) {}
  child {node[state_node] (s) {}
    child {node[action_node] (a1) {}}
    child {node[action_node] (a2) {}}
    child {node[action_node] (a3) {}}
  };
% I would like the graph to go here
\node[below] at (a3.south) {hi};

\draw [->] (a) edge (s);
\draw [name path=edge1, ->] (s) to (a1);
\draw [name path=edge2, ->] (s) to (a2);
\draw [name path=edge3, ->] (s) to (a3);

\path[name path=c] (s) circle (1);
\draw[name intersections={of=edge1 and c, by=intersection1},
      name intersections={of=edge3 and c, by=intersection2},
-, shorten >=0pt]
(intersection1) to[bend right] (intersection2);


\end{tikzpicture}
\caption{Q-learning backup diagram}
\end{figure}

% Miniature graphs that I would like to embed above
\begin{tikzpicture}
  \begin{axis} [
    axis lines=middle,
    xmin=0, xmax=1,
    ymin=0, ymax=1,
    xtick=\empty, ytick=\empty
  ]

  \addplot table {
    0.8   0
    0.8 0.3
    0.3 0.8
    0   0.8
  };

  \addplot table[only marks] {
    0.3 0.36
    0.8 0.3
    0.3 0.8
  };

  \end{axis}
\end{tikzpicture}

相关内容