有人可以帮我通过 tikz 绘制下面的图表吗(用于我的硕士论文)

有人可以帮我通过 tikz 绘制下面的图表吗(用于我的硕士论文)

我希望通过 tikz 绘制的图表附在下面。我是 LaTeX 新手,非常感谢您的帮助!

在此处输入图片描述

答案1

请求的向量在 tikz 中绘制

\documentclass{article}
\usepackage{tikz}

\begin{document}
    \begin{tikzpicture}
        \draw[rounded corners=0.4cm] (0, 0) rectangle (1, 5);
        \fill[fill=white] (0.3, -0.1) rectangle (0.7, 0.1);
        \fill[fill=white] (0.3, 4.9) rectangle (0.7, 5.1);
        \node at (0.5, 4) {\(P_1\)};
        \node at (0.5, 3) {\(P_2\)};
        \node at (0.5, 2) {\(\vdots\)};
        \node at (0.5, 1) {\(P_p\)};
        \node[text width=2.5cm] at (1, -1) {Process\\characteristics};
        
        \begin{scope}[xshift=3cm]
            \draw[rounded corners=0.4cm] (0, 0) rectangle (1, 5);
            \fill[fill=white] (0.3, -0.1) rectangle (0.7, 0.1);
            \fill[fill=white] (0.3, 4.9) rectangle (0.7, 5.1);
            \node at (0.5, 4) {\(T_1\)};
            \node at (0.5, 3) {\(T_2\)};
            \node at (0.5, 2) {\(\vdots\)};
            \node at (0.5, 1) {\(T_t\)};
            \node[text width=2.5cm] at (1, -1) {Technical\\characteristics};
        \end{scope}
        \node at (2, 2.5) {\(\longleftrightarrow\)};
        \begin{scope}[xshift=6cm]
            \draw[rounded corners=0.4cm] (0, 0) rectangle (1, 5);
            \fill[fill=white] (0.3, -0.1) rectangle (0.7, 0.1);
            \fill[fill=white] (0.3, 4.9) rectangle (0.7, 5.1);
            \node at (0.5, 4) {\(S_1\)};
            \node at (0.5, 3) {\(S_2\)};
            \node at (0.5, 2) {\(\vdots\)};
            \node at (0.5, 1) {\(S_p\)};
            \node[text width=2.5cm] at (1, -1) {Service\\characteristics};
        \end{scope}
        \node at (5, 2.5) {\(\longleftrightarrow\)};
        \node at (7, -2) {(Quality/Price)};
    \end{tikzpicture}
\end{document}

这是在 中执行此操作的一种方法tikz。由于这只是重复相同的内容,因此我使用示波器将副本移至正确的位置。请注意,在这种情况下,括号实际上是圆角矩形,顶部和底部覆盖着白色。因此,如果您想在白色以外的任何背景下查看此内容,则必须更改覆盖矩形的颜色。

答案2

还有一个解决方案,使用arrows.metapositioningTiZ 库,用于节点 writenf 的数学环境包内容amsmathmatrix

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                positioning}
\usepackage{amsmath}

\begin{document}
    \begin{tikzpicture}[
node distance = 0mm and 22mm,
            > = Straight Barb,
 every edge/.style = {draw, semithick, <->, 
                      shorten < = 1.5em, shorten > = 1.5em},
every label/.style = {label distance=1em, text width=7em, align=center},
N/.style = {inner sep=1em, align=center, 
            append after command={\pgfextra{\let\LN\tikzlastnode
            \draw[rounded corners=1.5ex, semithick]
                ([xshift=-1em] \LN.north) -| (\LN.west) |-
                ([xshift=-1em] \LN.south)
                ([xshift=+1em] \LN.north) -| (\LN.east) |-
                ([xshift=+1em] \LN.south);
              }}}
                        ]  
\renewcommand\arraystretch{2}                        
\node (n1) [N, label=below:Process Characteristic]  
                {$\begin{matrix}
                    P_1\\ P_2\\  \vdots\\ P_p
                 \end{matrix}$};
\node (n2) [N, right=of n1,
               label=below:Technical Characteristic ] 
                {$\begin{matrix}
                    T_1\\ T_2\\  \vdots\\ T_p
                 \end{matrix}$};
\node (n3) [N, right=of n2,
               label=below:{Service Characteristic (Quality/Price)} ]
                {$\begin{matrix}
                    S_1\\ S_2\\  \vdots\\ S_p
                 \end{matrix}$};
\path   (n1) edge (n2)
        (n2) edge (n3);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

我认为没有理由使用 Ti

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\newcommand{\underlabel}[2]{%
  \underset{\text{\footnotesize\begin{tabular}[t]{@{}c@{}}\\#1\end{tabular}}}{#2}%
}
\newcommand{\widepmatrix}[1]{%
  \left(
    \renewcommand{\arraystretch}{2}%
    \begin{array}{c} #1 \end{array}
  \right)
}
\underlabel{Process \\ characteristics}
 {\widepmatrix{P_1 \\ P_2 \\ \vdots \\ P_p}}
\longleftrightarrow
\underlabel{Technical \\ characteristics}
 {\widepmatrix{T_1 \\ T_2 \\ \vdots \\ T_t}}
\longleftrightarrow
\underlabel{Service \\ characteristics \\ (Quality/price)}
 {\widepmatrix{S_1 \\ S_2 \\ \vdots \\ S_s}}
\]

\end{document}

辅助命令仅在显示中定义,但如果您有类似文档中的其他对象,则可以移动序言中的定义。

在此处输入图片描述

相关内容