如何在 Tikz 中制作下图?

如何在 Tikz 中制作下图?

我正在尝试制作下图 在此处输入图片描述

这是我的尝试:

\documentclass{article}

\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\pagestyle{empty}


\tikzstyle{block} = [rectangle, draw, fill=blue!20, 
    text width=5.5em, text centered, rounded corners, minimum height=2em]

\tikzstyle{cloud} = [ellipse, draw, fill=red!20, text width=5em, align=center, inner xsep=0pt]


\begin{figure}[ht] % 'ht' tells LaTeX to place the figure 'here' or at the top of the page
\centering % centers the figure
\scalebox{0.6}{%
\begin{tikzpicture}[node distance=3cm]

\node[block] (A) {A};

\node[block,right of = A] (B) {B};

\node[block,below of = B] (D) {D};

\node[cloud,below of = D] (F) {F};

\node[block,right of =D] (E) {E};

\node[cloud,right of = F] (G) {G};

\node[block,above right of = E] (C) {C};

\node[cloud,right of=G] (H) {H};

\path (A) -- (B) node [midway] {=};

\path (D) -- (E) node [midway] {+};

\path (B) -- (C) node [midway] {+};

\draw[very thick]
(B) edge[below] node{} (D);

\draw[dashed, very thick]
(D) edge[below] node{} (F);

\draw[dashed,very thick]
(E) edge[below] node{} (G);

\draw[dashed,very thick]
(C) edge[below] node{} (H);
\end{tikzpicture}
}
\end{figure}


\end{document}

在下图中,我在将 D 和 E 节点置于中心以及将 } 朝下时遇到了困难...... 在此处输入图片描述

任何帮助,将不胜感激。

更新:我正在尝试应用 Zarko 的答案,但是当我尝试写入更长的字符串时,我得到了以下图片。

在此处输入图片描述

答案1

编辑: 现在被视为编辑问题。

这张图片再现了您在问题的第一个版本中提出的草图:

在此处输入图片描述

%\documentclass{article}
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                decorations.pathreplacing, 
                    calligraphy,% had to be load after decorations.pathreplacing
                positioning,
                shapes}

\begin{document}
    %\begin{figure}[ht]
    % \centering
    \begin{tikzpicture}[
node distance = 5mm and 3mm,
  start chain = going right,
    BC/.style = {decorate,
                 decoration={calligraphic brace, amplitude=4pt,
                 raise=5pt},
                 very thick, pen colour={black}
                },
   box/.style = {rounded corners=2pt, draw, fill=blue!20,
                 minimum height=4ex, inner xsep=5pt},
     C/.style = {ellipse, draw, fill=red!20,
                 align=center, font=\linespread{0.84}\selectfont, 
                 inner xsep=-4pt},
every edge/.style = {draw, densely dashed, -Straight Barb}
                    ]
    \begin{scope}[nodes={on chain}]
\node[box] (A) {Observation};
\node          {$=$};
\node[box] (B) {Computer Model};
\node          {$+$};
\node[box] (C) {Measurement error};
    \end{scope}
\node[box, below left =of B.south] (D) {Emulator};
\node[box, below right=of B.south] (E) {Bias Term};
\node[below=of B]   {$+$};
% brace
\draw[BC]   (D.north west) -- (E.north east);
% circles
\node[C,below=of D] (F) {Code\\ Uncertainity};
\node[C,below=of E] (G) {Model\\Discrapancy};
\node[C,below=of C |- E.south] (H) {Experimental\\ uncertainity};
% edges
\path   (D) edge    (F) 
        (E) edge    (G)
        (C) edge    (H);
    \end{tikzpicture}
%    \end{figure}
\end{document}

(对我而言),不清楚你提出问题后喜欢画什么。

相关内容