我怎样才能用乳胶制作这些图表?

我怎样才能用乳胶制作这些图表?

我需要用 latex 准备几个图表,最接近我需要做的是这两个图表,有人能提供一些提示吗?我熟悉 TikZ,但这些图表对我来说看起来像是高级水平。有人可以推荐一个包/插件等来实现这样的功能吗?

第一的

第二

答案1

以下是第二部分的一些代码:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{bbding}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,arrows}

\begin{document}

\newcommand\MyCross{\XSolid}

\begin{tikzpicture}[remember picture]
\begin{scope}
\matrix[matrix of nodes,column sep=-1mm] (mat1)
{
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \color{red}{\MyCross} & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
};
\draw[help lines] (mat1-4-2.north west) rectangle (mat1-5-7.south east);
\draw[-latex, shorten >=-3pt, shorten <=-3pt] (mat1-4-2) to[out=180,in=130] (mat1-5-2.160);
\node[anchor=south] at (mat1.north) {A};
\end{scope}
\begin{scope}[xshift=3.8cm]
\matrix[matrix of nodes,column sep=-1mm] (mat2)
{
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  &  & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  &  & \color{blue}{\MyCross} & \MyCross & \MyCross & \MyCross \\
 &  &  &  &  & \MyCross & \MyCross \\
 &  &  &  &  &  & \MyCross \\
};
\draw[help lines] (mat2-4-4.north west) rectangle (mat2-5-7.south east);
\node[anchor=south] at (mat2.north) {B};
\end{scope}
\begin{scope}[xshift=8cm]
\matrix[matrix of nodes,column sep=-1mm] (mat3)
{
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
};
\draw[help lines] (mat3-1-4.north west) rectangle (mat3-7-5.south east);
\node[anchor=south] at (mat3.north) {A};
\end{scope}
\begin{scope}[xshift=11.8cm]
\matrix[matrix of nodes,column sep=-1mm] (mat4)
{
 \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  & \MyCross & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  &  & \MyCross & \MyCross & \MyCross & \MyCross \\
 &  &  & \color{red}{\MyCross} & \MyCross & \MyCross & \MyCross \\
 &  &  &  &  & \MyCross & \MyCross \\
 &  &  &  &  &  & \MyCross \\
};
\draw[help lines] (mat4-1-4.north west) rectangle (mat4-5-5.south east);
\draw[-latex, shorten >=-3pt, shorten <=-3pt] (mat4-5-5) to[out=270,in=-40] (mat4-5-4.-80);
\node[anchor=south] at (mat4.north) {B};
\end{scope}
\draw ( $ (mat2-1-7)!.5!(mat3-1-1) + (0,0.5) $ ) -- +(0,-4.6);
\end{tikzpicture}

\end{document}

在此处输入图片描述

以下是第一部分的代码(基于菲穆穆的代码):

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=1.5]
\foreach \x in {0,...,9} {
  \node at (\x-.35,-0.6) {$v_{\x}$};
}
\clip (-0.3,-1.3) rectangle (8.3,4.3);
\foreach \x in {0,...,8} {
  \foreach \y in {0,...,4} {
    \node at  (\x cm,\y cm) (g-\x-\y) {$G_{\x,\y}$};
  }
}
\foreach \y in {0,...,3} {
  \foreach \x in {0,...,8} {
    \draw[->,shorten <=2pt,shorten >=7pt] (g-\x-\y) -- +(0,20pt);
  }
}
\foreach \y in {0,...,4} {
  \foreach \x in {0,...,7} {
    \draw[->,shorten >=2pt,shorten >=7pt] (g-\x-\y) -- +(20pt,0);
  }
}
\foreach \y in {0,...,3} {
  \foreach \x in {1,...,8} {
    \draw[->] (\x-.3,\y+.3) -- (\x - .6, \y+.6);  
  }
}
\foreach \x in {0,...,11} {
  \draw[dashed,thick] (\x-4.35,5) -- (\x + .65, 0);
}
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

没有完整的工作解决方案,但至少有一个可以开始的东西(对于第一个图,第二个图应该更简单):

\begin{tikzpicture}[scale=1.2]
  \foreach \x in {0,...,8} {
    \foreach \y in {0,...,4} {
      \node at  (\x cm,\y cm) {$G_{\x,\y}$};
      \draw[->] (\x-.3,\y+.3) -- (\x - .6, \y+.6);
      \draw[->] (\x-.2,\y+.3) -- (\x - .2, \y+.6);
      \draw[->] (\x+.3,\y) -- (\x + .6, \y);
    }
  }
  \foreach \x in {0,...,7} {
    \draw[dashed,thick] (\x-1.35,5) -- (\x + 3.65, 0);
  }
\end{tikzpicture}

相关内容