是否可以使用 tikz 套件在 Latex 中繪製這樣的圖形?

是否可以使用 tikz 套件在 Latex 中繪製這樣的圖形?
  • 所需的圖像類似於以下圖像:

在此輸入影像描述

  • 圖像代碼與顯示的圖像並不完全相關
  • 我的問題是如何更改將重現顯示圖像的顯示程式碼
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{csvsimple}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{relsize}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage[T1]{fontenc}
\title{table try}
\author{Jof Frimpong}
\date{October 2022}
\usepackage{float}
\usepackage{tikz}
    \usetikzlibrary{decorations.pathreplacing,calligraphy}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{fillbetween}

\begin{document}
\maketitle
    
\section{Introduction}
    
\begin{table}[H]
    \centering
    \csvautotabular[]{latextry.csv}
\end{table}

    \begin{center}
\begin{tikzpicture}
    
    % \draw[](0,0) grid (5,5)
    \node[draw](a) at (0,0){Audit Fees};
    \node[draw](b) at (9,0){Profitability};
    \node[draw](c) [below of =a]{Audit Tenure};
    \node[draw](d) [below right of =b]{liquidity};
    \node[draw](e) [below  of =c]{firm size};
    \node[draw](f) at (0,-6){Board Size};
    \node[draw,fill=blue,text=white,shape=circle](g) at (5,0){\huge Audit Qualtiy};
    
    \draw[-latex](a) to (g);
    \draw[stealth-](c) to (g);
    \draw[line width=3pt][-{stealth [scale width=2]}](d) to (g);
    \draw[line width=3pt][-latex](f) to (g);
\end{tikzpicture}
    \end{center}
\end{document}

答案1

在痛苦地拉出你所追求的東西之後......看來,你正在尋找以下內容:

在此輸入影像描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                calc, chains,
                decorations.pathreplacing,
                calligraphy,
                positioning,
                shapes}

\begin{document}
    \begin{figure}[ht]
    \centering
\begin{tikzpicture}[
node distance = 5mm and 16mm,
  start chain = going below,
   arr/.style = {-Stealth, very thick, color=cyan},
    BC/.style args = {#1/#2}{decorate,
                decoration={calligraphic brace, amplitude=6pt,
                pre =moveto, pre  length=1pt,
                post=moveto, post length=1pt,
                raise=#1, mirror},
                ultra thick,
                pen colour={#2}},
   BCL/.style args = {#1/#2}{draw=#1, rounded corners, 
                semithick, below=#2},      
     E/.style = {ellipse, draw=cyan, semithick, 
                 fill=cyan!30, font=\Large\bfseries},
     N/.style = {draw=cyan, semithick, minimum width = 8em, inner sep=1ex}
                    ]
    \begin{scope}[nodes={N, on chain}]
\node (a)   {text};
\node (b)   {text};
\node (c)   {text};
\node (d)   {text};
    \end{scope}
\node (e) [E, left= of {$(b.west)!0.5!(c.west)$}]  {TEXT};
%
\node (f) [N, left=of e.west |- a]   {text};
\node (g) [N, left=of e.west |- d]   {text};
%
    \foreach \i [count=\j]in {a,b,c,d, f,g}
{
\ifnum\j<5
    \draw[arr]   (\i.west) -- (e);
\else
    \draw[arr]   (\i.east) -- (e);
\fi
}
%
    \begin{scope}[nodes={BCL=orange/5mm}]
\draw[BC=3pt/orange]    (g.south west) 
                                -- node {text}
                        (g.south east);
\draw[BC=3pt/orange]    (e.west  |- d.south)
                                -- node {text}
                        (e.east  |- d.south);
\draw[BC=3pt/orange]    (d.south west)
                                -- node {text}
                         (d.south east);
    \end{scope}
\end{tikzpicture}
    \end{figure}
\end{document}

附錄:

  • 恐怕,所顯示的圖像被簡化了......最終的成像器是不同的(再次=:-)
  • 所需影像左側有七個節點,右側有五個節點
  • 透過對第一個版本的答案進行以下更改可以簡單地完成這些更改:
    • 定義兩個節點chanis)L和R),一個用於左側,一個用於右側
    • 先繪製左鏈,再繪製中間節點,最後再繪製右鏈
    • 仍然預計,鏈節點中的文字為一行且短於或等於8em
    • 命名鏈(L左側、R右側);這是程式碼更短更簡單的一點:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                decorations.pathreplacing,
                calligraphy,
                positioning,
                shapes}

\begin{document}
    \begin{figure}[ht]
    \centering
\begin{tikzpicture}[
node distance = 5mm and 16mm,
  start chain = L going below,      % added chain name, for leftside chain 
  start chain = R going below,      % new chain, for rightside 
   arr/.style = {-Stealth, very thick, color=cyan},
    BC/.style args = {#1/#2}{decorate,
                decoration={calligraphic brace, amplitude=6pt,
                pre =moveto, pre  length=1pt,
                post=moveto, post length=1pt,
                raise=#1, mirror},
                ultra thick,
                pen colour={#2}},
   BCL/.style args = {#1/#2}{draw=#1, rounded corners, 
                semithick, font=\scshape, 
                align=center, below=#2},      
     E/.style = {ellipse, draw=cyan, semithick, 
                 fill=cyan!30, font=\Large\bfseries,
                 align=center},
     N/.style = {draw=cyan, semithick, minimum width = 8em, 
                 align=center, inner sep=1ex}
                    ]
    \begin{scope}[nodes={N, on chain=L}] % leftside chain of 7 nodes
\node   {text L1}; % node name: L-1
\node   {text L2};
\node   {text L3};
\node   {text L4};
\node   {text L5};
\node   {text L6};
\node   {text L7};
    \end{scope}
\node (e) [E, right= of L-4]  {TEXT\\ TEXT};
%
    \begin{scope}[nodes={N, on chain=R}] % rightside chain of 5 nodes
\node   [right=of L-2 -| e.east]
        {text R1}; % node name: R-1
\node   {text R2};
\node   {text R3};
\node   {text R4};
\node   {text R5};
    \end{scope}
%
\foreach \i in {1, 2,...,7}
    \draw[arr]   (L-\i.east) -- (e);
\foreach \i in {1, 2,...,5}
    \draw[arr]   (R-\i.west) -- (e);

%
    \begin{scope}[nodes={BCL=orange/5mm}]
\draw[BC=3pt/orange]    (L-7.south west) 
                                -- node {left side\\ nodes} 
                        (L-7.south east);
\draw[BC=3pt/orange]    (e.west  |- L-7.south)
                                -- node {text}
                        (e.east  |- L-7.south);
\draw[BC=3pt/orange]    (R-5.west |- L-7.south)
                                -- node {right side\\ nodes} 
                        (R-5.east |- L-7.south);
    \end{scope}
\end{tikzpicture}
    \end{figure}
\end{document}

在此輸入影像描述

相關內容