如何在 LaTeX 中绘制图表?

如何在 LaTeX 中绘制图表?

我正在尝试在 LaTeX 中复制我在 Word 中创建的这个图形,我不想只插入图形(合并图像的最简单方法),而是从零开始创建它。有什么建议或想法吗?

在此处输入图片描述

答案1

这是一个不像您的代码那样依赖绝对坐标的版本。稍微更新了代码,将一些文本移到了线下,添加了示例中的箭头,并使用库fit绘制了周围的框架(事后看来,这可以代替它完成\draw (current bounding box.south east) rectangle (current bounding box.north west);。)

在此处输入图片描述

\documentclass[border=4mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart,arrows.meta,positioning,fit}
\begin{document}
\begin{tikzpicture}[
  axis/.style={very thick,<->,>=Latex},
  MyArrow/.style={-Stealth},
  every node/.append style={font=\scriptsize},
  node distance=3mm]

\coordinate (origin) at (0,0);
\draw[axis] (-2.5, 0) -- (12.5,0)
  coordinate (right) coordinate [pos=0] (left)
  node[pos=0.95,below] {Higher}
  node[pos=0.93,above,align=center,font=\bfseries\scriptsize] {Phenomenom\\Amplitude};
\draw[axis] (0, -3) -- (0,3.5) 
  node[pos=0.03,left] (lower) {Lower}
  node[pos=0.97,left] {Higher}
  node[above] (abslev) {\textbf{Abstraction level}};
\node [above left,
       minimum width=2.5cm,minimum height=3cm,
       draw,align=center,font=\bfseries\scriptsize] (theory) at (origin) {Space of\\Theory};
\node [below left,
       minimum width=2.5cm,minimum height=2.4cm,
       draw,align=center,font=\bfseries\scriptsize] (obs) at (origin) {Space of\\Measurement\\and\\Observation};

\node [below right] at (origin) {Lower};

\node [above=2mm,align=center] (empreg) at (6,0) {%
\textbf{Empirical regularities -- Observable concepts:}%
  };

\node [above=of empreg,align=center] (subthe) {%
\textbf{Substantive Theories:}\\%
\textit{Dualist; Structuralist; Regulationist; Voluntarist}%
  };

\node [above=of subthe,xshift=1cm,align=center] (genthe) {%
\textbf{General Theory:}\\%
\textit{Institutionalism Political Economy}%
  };
\node [above=of genthe,xshift=1cm,align=center] (para) {%
\textbf{Paradigm:}\\%
\textit{Structural Constructivism}%
  };

\draw[MyArrow] (para) -- (genthe);
\draw[MyArrow] (genthe) -- (subthe);
\draw[MyArrow] (subthe) -- (empreg);

\node [below=4mm of empreg,align=center,font=\itshape\scriptsize] (ecstr) {%
Political Structure: State, Government, Regulatory Framework, Social Class\\
Economic Structure: Market, Work-Employment, Capital\\
Public Policies: Development, Social, Labour, Vocational Training\\
Workers: Informal and Formal Sector – Self-Employment, Conditions};

% three arrows
\draw [-Stealth] (empreg.south) -- (ecstr.north);
\draw [-Stealth] ([xshift=3mm]empreg.south) -- ([xshift=3mm]ecstr.north);
\draw [-Stealth] ([xshift=-3mm]empreg.south) -- ([xshift=-3mm]ecstr.north);

% draw rectangle
\node [fit=(left)(right)(lower)(abslev),draw,inner xsep=0pt] {};

\end{tikzpicture}

\end{document}

答案2

我尝试使用以下代码:

\begin{center}
\begin{figure}
\caption{Levels of abstraction in the theoretical framework} \label{fig:1}
\vspace*{-5mm}
\begin{tikzpicture}[scale=0.9, transform shape]
%\draw[step=1cm,gray,very thin] (0,0) grid (15,7); %Lineas guias 
\draw[thick] (0,1) rectangle (15,7); %Rectangulo de afuera
\draw[thick, <->] (0, 3) -- (15,3); %Linea eje imaginario X
\draw[thick, <->] (2.5, 1) -- (2.5,6.5); %Linea eje imaginario de Y 
\draw[thick] (0,1.5) rectangle (2.5,3); % Space of Measurement Rectangulo
\draw[thick] (0,3) rectangle (2.5, 6.125); %Space of Theory Rectangulo
\draw[->] (11.5,6) -- (11,5.75) ; %Conector entre Paradigma y Teoría General
\draw[->] (10.5,5) -- (10,4.75) ; %Teoría General y Teoría Sustantiva
\draw[->] (9.5,4) -- (9,3.75) ; %Teoría Sustantiva y Regularidades empíricas
\draw[->] (8.5, 3.25) -- (8.5, 2.75) ; % Linea que conecta a Regularidades empiricas
\draw[->] (8, 3.25) -- (8, 2.75) ; % Linea que conecta a Regularidades empiricas
\draw[->] (9, 3.25) -- (9, 2.75) ; % Linea que conecta a Regularidades empiricas
\node at (14,3.5) {\scriptsize{\textbf{Phenomenom}}};
\node at (14,3.2) {\scriptsize{\textbf{Amplitute}}};
\node at (14,2.8) {\scriptsize{Higher}};
\node at (3,2.8) {\scriptsize{Lower}};
\node at (2.5,6.7) {\scriptsize{\textbf{Abstraction Level}}};
\node at (2,6.3) {\scriptsize{Higher}};
\node at (2,1.25) {\scriptsize{Lower}}; 
\node at (1.25, 2.55) {\scriptsize{\textbf{Space of}}};
\node at (1.25, 2.25) {\scriptsize{\textbf{Measurment and}}};
\node at (1.25, 1.95) {\scriptsize{\textbf{Observation}}};
\node at (1.25, 4.7) {\scriptsize{\textbf{Space of}}};
\node at (1.25, 4.4) {\scriptsize{\textbf{Theory}}};
\node at (11.5, 6.55) {\scriptsize{\textbf{Paradigm:}}};
\node at (11.5, 6.25) {\scriptsize{\textit{Structural Constructivism}}};
\node at (10.5, 5.55) {\scriptsize{\textbf{General Theory:}}};
\node at (10.5, 5.25) {\scriptsize{\textit{Institutionalism Political Economy}}};
\node at (9.5, 4.55) {\scriptsize{\textbf{Substantive Theories:}}};
\node at (9.5, 4.25) {\scriptsize{\textit{Dualist; Structuralist; Regulationist; Voluntarist}}};
\node at (8.5, 3.5) {\scriptsize{\textbf{Empirical regularities - Observable concepts:}}};
\node at (8.5, 2.45) {\scriptsize{\textit{Political Structure: State, Government, Regulatory Framework, Social Class}}};
\node at (8.5, 2.15) {\scriptsize{\textit{Economic Structure: Market, Work-Employment, Capital}}};
\node at (8.5, 1.85) {\scriptsize{\textit{Public Policies: Development, Social, Labour, Vocational Training}}};
\node at (8.5, 1.55) {\scriptsize{\textit{Workers: Informal and Formal Sector – Self-Employment, Conditions}}};
\end{tikzpicture}
\vspace*{-2.5mm}
\caption*{{\scriptsize\textit{\textbf{Source:} Own theoretical diagram based on  Sautu, Boniolo, Dalle \& Elbert (2005)}}}
\end{figure}
\end{center}

并且它运行正常。

我的结果是:

在此处输入图片描述

这与第一张图不同,因为我意识到经验规律应该在线之下。

相关内容