帮助处理 TikZ 中的图形

帮助处理 TikZ 中的图形

我们如何使用 TikZ 和 LaTeX 制作下面的图 1 和图 2?

在图 2 中,我想为不同的象限赋予不同的颜色。

图1 图 2

答案1

我使用 TikZ,因为问题是关于 TikZ 的,但我认为它是绘制这些图片的最佳工具。配置起来非常容易。我只使用\node

\documentclass[a4paper,10pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{fourier,tikz}
\usetikzlibrary{arrows,calc}

\begin{document}

  \newcommand\spaceitem{8ex}
  \begin{figure}[!ht]
\begin{tikzpicture}[every node/.style={text width=5cm,align=left},>=triangle 90]   
\node[anchor=west] (a1)   {Emphasises research  content};
\node[anchor=west] (a2) at ($(a1.west)-(0,\spaceitem)$)%
                          {Students are treated as the audience};
\node[anchor=west] (a3) at ($(a2.west)-(0,\spaceitem)$) 
                          {Teaching is teacher-focused};   
\node[anchor=east] (b1) at (\linewidth,0) 
                          {Emphasises research processes and problems};
\node[anchor=east] (b2) at ($(b1.east)-(0,\spaceitem)$) 
                          {Students are treated as participants};
\node[anchor=east] (b3) at ($(b2.east)-(0,\spaceitem)$) 
                          {Teaching is student-focused};    
\begin{scope}[<->,thick]
    \draw (a1.east) -- (b1.west);
    \draw (a2.east) -- (b2.west);
    \draw (a3.east) -- (b3.west);
\end{scope}
\end{tikzpicture}
\caption{Three dimensions of curriculum design}
  \label{fig:threedim}
\end{figure} 

  \begin{figure}[!ht]    
\begin{tikzpicture}[font=\small]
  \begin{scope}[every node/.style={%
  text width=3.5cm,text depth=3cm,inner sep = 2mm,
  minimum height=3cm,minimum width=3.5cm,
  align=left}]

\node[fill=blue!20](T1){\textbf{Research-tutored}\\[.6ex]
    \textit{Curriculum emphasises learning focused on students writing and
    discussing papers or essays}};

 \node[fill=red!20,anchor=north west](T2) at (T1.north east){%
 \textbf{Research-based}\\[.6ex]
 \textit{Curriculum emphasises students undertaking inquiry-based learning }};

\node[fill=green!20,anchor=north west](T3) at (T1.south west){%
\textbf{Research-led}\\[.6ex]
\textit{Curriculum is structured around teaching subject content}};

\node[fill=yellow!20,anchor=north west](T4) at (T1.south east){%
\textbf{Research-oriented}\\[.6ex]
\textit{Curriculum emphasises teaching processes of knowledge
construction in the subject}}; 
\end{scope}


\begin{scope}[align=center]
 \node [text width=6cm,above=3ex,anchor=south] (T5) at (T1.north east)
   {\textbf{STUDENT-FOCUSED \\ STUDENTS AS PARTICIPANTS}};

 \node [text width=6cm,below=3ex,anchor=north] (T6) at (T3.south east) {%
    \textbf{TEACHER-FOCUSED \\ STUDENTS AS AUDIENCE}}; 


 \node [text width=2cm,left=3ex,anchor=east](T7) at (T1.south west) 
   {\textbf{EMPHASIS ON \\ RESEARCH \\ CONTENT}};

 \node [text width=2cm,right=3ex,anchor=west](T8) at (T2.south east) {%
   \textbf{EMPHASIS ON \\ RESEARCH \\ PROCESSES \\ AND \\ PROBLEMS}};
\end{scope}

\draw[thick] (T5) -- (T6)
             (T7) -- (T8) ;   
\end{tikzpicture} 
\caption{Curriculum design and the research-teaching nexus}
  \label{fig:Curriculum}
\end{figure}  
\end{document}

在此处输入图片描述

答案2

以下是第一张图的一些代码:

\documentclass{article}
\usepackage{MnSymbol}
\usepackage{array}

\newcommand\DblArrow{%
  $\filledmedtriangleleft\mkern-\thickmuskip\vcenter{\hbox{\rule{3cm}{0.4pt}}}
    \mkern-\thickmuskip\filledmedtriangleright$}

\begin{document}

\begin{figure}[!ht]
  \centering\renewcommand\arraystretch{1.7}
  \begin{tabular}{@{}>{\raggedright\arraybackslash}m{3.7cm}!{\DblArrow}
      >{\raggedright\arraybackslash}m{3.7cm}@{}}
    Emphasises research content & Emphasises research processes and problems \\
    Students are treated as the audience & Students are treated as participants \\
    Teaching is teacher-focused & Teaching is student-focused
  \end{tabular}
  \caption{Three dimensions of curriculum design}
  \label{fig:threedim}
\end{figure}

\end{document}

在此处输入图片描述

答案3

好吧,你专门要求 TikZ,但我确实喜欢其他解决方案:

\documentclass[a4paper]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}

\begin{document}
\begin{tikzpicture}[every node/.style={text width=4.5cm,align=left},>=triangle 90]
  \node (a1) {Emphasises research \\ content};
  \node (a2) [below=.5cm of a1] {Students are treated as the audience};
  \node (a3) [below=.5cm of a2] {Teaching is teacher-focused};
  \node (b1) [right=2.5cm of a1] {Emphasises research \\ processes and problems};
  \node (b2) [right=2.5cm of a2] {Students are treated as participants};
  \node (b3) [right=2.5cm of a3] {Teaching is student-focused};
  \begin{scope}[<->,very thick,shorten <=-.5cm,shorten >=.3cm]
    \draw (a1) -- (b1);
    \draw (a2) -- (b2);
    \draw (a3) -- (b3);
  \end{scope}
\end{tikzpicture}

\begin{tikzpicture}
\matrix (m) [every node/.style={%
  text width=3.5cm,text depth=3cm,
  minimum height=3.4cm,minimum width=4cm,
  align=left,font=\small},
  row sep=5pt,column sep=5pt] {
  \node[fill=blue]{\textbf{Research-tutored}\\[.6ex]
    \textit{Curriculum emphasises learning focused on students writing and
    discussing papers or essays}};
  &
  \node[fill=red]{\textbf{Research-based}\\[.6ex]
    \textit{Curriculum emphasises students undertaking
    inquiry-based learning }};
  \\
  \node[fill=green]{\textbf{Research-led}\\[.6ex]
    \textit{Curriculum is structured around teaching subject content}};
  &
  \node[fill=yellow]{\textbf{Research-oriented}\\[.6ex]
    \textit{Curriculum emphasises teaching processes of knowledge
    construction in the subject}};
  \\
  };
\draw [ultra thick,shorten >=-.5cm,shorten <=-.5cm] (m.north) -- (m.south);
\draw [ultra thick,shorten >=-.5cm,shorten <=-.5cm] (m.east) -- (m.west);
\node [above=0.6cm of m,font=\scriptsize,text width=6cm,align=center]
  {\textbf{STUDENT-FOCUSED \\ STUDENTS AS PARTICIPANTS}};
\node [left=0.3cm of m,font=\scriptsize,text width=3cm,align=left] {%
  \textbf{EMPHASIS ON \\ RESEARCH \\ CONTENT}};
\node [right=0.6cm of m,font=\scriptsize,text width=3cm,align=left] {%
  \textbf{EMPHASIS ON \\ RESEARCH \\ PROCESSES \\ AND \\ PROBLEMS}};
\node [below=0.6cm of m,font=\scriptsize,text width=6cm,align=center] {%
  \textbf{TEACHER-FOCUSED \\ STUDENTS AS AUDIENCE}};
\end{tikzpicture}
\end{document}

答案4

这是第二张图;对于 beamer 你可能不得不这样说

\resizebox{!}{.8\textheight}{%`

代替\resizebox{\textwidth}{!}{%

\documentclass[a4paper]{article}
\usepackage{array,graphicx,color}
\usepackage[margin=1cm]{geometry}

\begin{document}

\noindent\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}>{\bfseries}l@{}}
EMPHASIS ON\\
RESEARCH\\
CONTENT
\end{tabular}
\begin{tabular}{@{\hspace{.5cm}}c|c@{\hspace{.5cm}}}
\multicolumn{2}{c}{\bfseries STUDENT-FOCUSED}\\
\multicolumn{2}{c}{\bfseries STUDENTS AS PARTICIPANTS}\\
\colorbox{green}{%
\parbox[t][3.5cm][t]{3.5cm}{\raggedright\vspace*{.5cm}
\textbf{Research-tutored}\\[2ex]
\itshape Curriculum emphasises
learning focused on
students writing and
discussing papers or
essays}}
&
\colorbox{blue}{%
\parbox[t][3.5cm][t]{3.5cm}{\raggedright\vspace*{.5cm}
\textbf{Research-based}\\[2ex]
\itshape Curriculum emphasises
students undertaking
inquiry-based learning}}\vrule width0pt depth 3.8cm
\\
\hline
\colorbox{black}{\color{white}%
\parbox[t][3.5cm][t]{3.5cm}{\raggedright
\vspace*{1ex}
\textbf{Research-led}\\[2ex]
\itshape Curriculum is structured
around teaching subject
content}}
&
\colorbox{red}{%
\parbox[t][3.5cm][t]{3.5cm}{\raggedright
\vspace*{1ex}
\textbf{Research-oriented}\\[2ex]
\itshape Curriculum emphasises
teaching processes of
knowledge construction
in the subject}}\vrule width0pt depth 3.8cm
\\
\multicolumn{2}{c}{\bfseries TEACHER-FOCUSED}\\
\multicolumn{2}{c}{\bfseries STUDENTS AS AUDIENCE}
\end{tabular}
\begin{tabular}{@{}>{\bfseries}l@{}}
EMPHASIS ON\\
RESEARCH\\
PROCESSES\\
AND\\
PROBLEMS
\end{tabular}}
\end{document}

对于第一个图表,也许 TikZ 更好。

相关内容