如何将两个 tikz 矩阵彼此相邻放置,并在它们之间添加双线箭头

如何将两个 tikz 矩阵彼此相邻放置,并在它们之间添加双线箭头

嗨,我创建了两个 tikz 矩阵。我想将名为 b 的矩阵放在名为 a 的矩阵的右侧。这两个矩阵必须在页面上并排平行。我不确定该怎么做。我还想在 tikz 中绘制一个相当大的双线箭头,从矩阵 a 指向矩阵 b。如果我尝试使用代码连接这两个矩阵:

\draw [arrow style] (a) -- (b);它给了我从矩阵 b 向下绘制的一条奇怪的线。

这是我已经尝试过的代码。


\documentclass{article}

% Let's input our packages and styles;


% \input{packages.tex}

% \input{styles.tex}

\usepackage[utf8]{inputenc}

\usepackage{tikz}

\usepackage{ifthen}


\title{generic flow chart}

\author{Daniel}

\date{December 2022}

\begin{document}



%%% The tikz packages im using;




\usetikzlibrary{ arrows.meta, 
   calc, chains,
 positioning, 
 shadows, shapes}

%%%%%%%%%%%%%%     The styles im using; %%%%%%%%%%%%%%%%%%%%

\tikzstyle{arrow style} = [-{Latex[scale = 1.5]} , semithick]
 
 
 %%%%%%%%%%%%%%%%%%%%% This is the start of my tikz figure  %%%%%%%%%%%%%%%%%%%%%%




\begin{tikzpicture}
\matrix [draw , column sep=0.1cm , row sep = 1cm](a) at (0,0)
{
;&   \draw node(a)[align = left]   {\textbf{\small REAL WORLD}};\\
     \draw node(b)[align = left]   {\textbf{\large Unknown} \\ \textbf{\large probability} }; &; 
 &   \draw  node(c)[align = left] {\textbf{\large Observed} \\ \textbf{\large Data}};\\
     \draw node(d)[align = left]      {\textbf{P}}; &; &\draw  node(e)[align = left] {$\mathbf{x} = (x_{1} , x_{2} , \dots x_{n})$};\\
;& ; & \draw  node(f)[align = left]{$\hat{\theta} = s(\mathbf{x})$};\\
;&  \draw node(a)[align = left]   {\textbf{\small STATISTIC OF INTEREST}};\\
};

% Arrows on first matrix:


\draw [arrow style]  (d) --  (e);

\draw [arrow style]  (e) --  (f);

\matrix [draw , column sep=0.1cm , row sep = 1cm](b) at (0,-12)
{
;&   \draw node(a)[align = left]   {\textbf{\small BOOTSTRAP WORLD}};\\
     \draw node(b)[align = left]   {\textbf{\large Estimated} \\ \textbf{\large Probability} \\ \textbf{\large Model}}; &; 
 &   \draw  node(c)[align = left] {\textbf{\large Bootstrap} \\ \textbf{\large Sample}};\\
     \draw node(d)[align = left]      {$\mathbf{\hat{P}}$}; &; &\draw  node(e)[align = left] {$\mathbf{x}^{*} = (x_{1}^{*} , x_{2}^{*} , \dots x_{n}^{*})$};\\
;& ; & \draw  node(f)[align = left]{${\hat{\theta}}^{*} = s(\mathbf{x}^{*})$};\\
;&  \draw node(a)[align = left]   {\textbf{\small STATISTIC OF INTEREST}};\\
};

 % arrows on second matrix;


\draw [arrow style]  (d) --  (e);

\draw [arrow style]  (e) --  (f);

\draw [arrow style]  (a) --  (b);

% connecting the big matrices with a double arrow;







\end{tikzpicture}   


\end{document}

下面是我在 tikz 中尝试复制的图片:

在此处输入图片描述

我当前的输出如下:

在此处输入图片描述

答案1

像这样?

在此处输入图片描述

好吧,正如你所见,我重新设计了你的形象(很多)。也许你会喜欢

相关内容