我如何使用 tikz 绘制该图表?

我如何使用 tikz 绘制该图表?

这是图表的图片

在此处输入图片描述

答案1

在此处输入图片描述

\documentclass[border=10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows,calc}
    \begin{document}
        \begin{tikzpicture}[auto,
            block/.style={rectangle, draw=black, thick, fill=white,
                text width=4em, text centered,
                minimum height=1em, inner sep=2pt},
            blk/.style={rectangle, draw=none, thick, fill=white,
                text width=4em, text centered,
                minimum height=1em, inner sep=2pt},
            line/.style ={draw, thick, -latex', shorten >=0pt, rounded corners}
            ]

            \node [block] (a) {TEXT 1};
            \node [blk,above=1ex of a] (b) {TEXT 2}; 
            \node [block,above=1.5cm of b] (c) {TEXT 3}; 
            \node [blk,above=1ex of c] (d) {TEXT 4};
            \node [blk,above=2ex of d] (e) {TEXT 5};
            \node [block, right=2cm of a] (a1) {TEXT 1};
            \node [blk,above=1ex of a1] (b1) {TEXT 2}; 
            \node [block,above=1.5cm of b1] (c1) {TEXT 3}; 
            \node [blk,above=1ex of c1] (d1) {TEXT 4};
            \node [blk,above=2ex of d1] (e1) {TEXT 5};

            \begin{scope}[every path/.style=line]
                \path (c) -- (b);
                \path (c1) -- (b1);
                \path (e) -- (d);
                \path (e1) -- (d1);
                \draw[out=180, in=180, looseness=1.2] (a) to node[above,sloped ] {\footnotesize textt}(c);
                \draw[out=0, in=0, looseness=1.2] (a1) to node[rotate=180, above,sloped ] {\footnotesize texttt}(c1);
                \draw[<->, ](d)-- (d1)node[midway,above ] {\footnotesize text6};
                \draw[<->, ](b)--(b1)node[midway,below ] {\footnotesize text7};
                \draw[<->, shorten >=2pt,shorten <=2pt,](b)--(c1)node[pos=0.2,above,sloped ] {\footnotesize text8};
                \draw[<->, shorten >=2pt,shorten <=2pt,](b1)--(c)node[pos=0.2,above,sloped ] {\footnotesize text9};             
            \end{scope}
        \end{tikzpicture}
        
\end{document}

答案2

在此处输入图片描述

\documentclass[border=10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows,calc}
    \begin{document}
        \begin{tikzpicture}[auto,
            block/.style={rectangle, draw=black, thick, fill=white,
                text width=6em, text centered,
                minimum height=1em, inner sep=2pt},
            blk/.style={rectangle, draw=none, thick, fill=white,
                text width=8em, text centered,
                minimum height=1em, inner sep=2pt},
            line/.style ={draw, thick, -latex', shorten >=0pt, rounded corners}
            ]

            \node [block] (a) {$V(p_1,p_2,m)$};
            \node [blk,above=1ex of a] (b) {Utilidad indirecta}; 
            \node [block,darkgreen,fill=darkgreen!20,above=2.5cm of b] (c) {$x_1(p_1,p_2,m)$}; 
            \node [blk,above=2ex of c] (d) {Maximización};
            \node [blk,above=4ex of d] (e) {Utilidad\\Problema de la maximización de la Utilidad (The UMP)};
            \node [block, right=4cm of a] (a1) {$e(p_1,p_2,u_0)$};
            \node [blk,above=1ex of a1] (b1) {Gasto mínimo}; 
            \node [block,above=2.5cm of b1] (c1) {$h_1(p_1,p_2,u_0)$}; 
            \node [blk,above=2ex of c1] (d1) {Minimización};
            \node [blk,above=4ex of d1] (e1) {Gasto\\Problema de la minimización del Gasto (The EMP)};
            \begin{scope}[every path/.style=line]
                \path (c) -- (b);
                \path (c1) -- (b1);
                \path (e) -- (d);
                \path (e1) -- (d1);
                \draw[out=180, in=180, looseness=1.2] (a) to node[above,sloped ] {\footnotesize Identidad de Roy}(c);
                \draw[dashed][out=0, in=0, looseness=1.2] (a1) to node[rotate=180, above,sloped] {\footnotesize Lema de Sheppard}(c1);
                \draw[<->, ](d)-- (d1)node[midway,above ] {\footnotesize Dualidad};
                \draw[<->, ](b)--(b1)node[midway,below ] {\footnotesize Dualidad};
                \draw[latex-latex,darkgreen, dashed ](c)--(c1)node[midway,above ] {\footnotesize Ecuación de Slutsky}node[midway,below ] {\footnotesize (for derivatives)};
                \draw[<->, shorten >=2pt,shorten <=2pt,](b)--(c1)node[pos=0.2,above,sloped ] {\footnotesize Dualidad};
                \draw[<->, shorten >=2pt,shorten <=2pt,](b1)--(c)node[pos=0.2,above,sloped ] {\footnotesize Dualidad};             
            \end{scope}
        \end{tikzpicture}
\end{document}

相关内容