我想画下图。我该怎么做?在图形之间画一些线条,你能给我这些线条上色吗?
图中部分颜色线条,如下图:
答案1
可能是这样的:
\documentclass{article}
\usepackage{colortbl}
\usepackage{arydshln,graphicx,xcolor,array}
\begin{document}
\arrayrulecolor{magenta}%
\setlength{\arrayrulewidth}{1pt}%
\begin{tabular}{c;{2pt/2pt}c|}
\includegraphics[width=3cm]{example-image-a} & \includegraphics[width=3cm]{example-image-b}
\end{tabular}
\arrayrulecolor{blue}%
\setlength{\arrayrulewidth}{1pt}%
\begin{tabular}{c;{2pt/2pt}c}
\includegraphics[width=3cm]{example-image-a} & \includegraphics[width=3cm]{example-image-b}
\end{tabular}
\end{document}
如果您不介意使用tikz
,您可以使用matrix
的库tikz
并以任何您喜欢的方式绘制线条。这种方法用途广泛。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (a)[row sep=0mm, column sep=0mm, inner sep=1mm, matrix of nodes] at (0,0) {
\includegraphics[width=3cm]{example-image-a} &
\includegraphics[width=3cm]{example-image-b} &
\includegraphics[width=3cm]{example-image-c}\\
\includegraphics[width=3cm]{example-image-a} &
\includegraphics[width=3cm]{example-image-b} &
\includegraphics[width=3cm]{example-image-c}\\\\
};
%
\draw[thick,red] (a-1-1.north east) -- (a-2-1.south east);
\draw[thick,densely dashed,blue] (a-1-2.north east) -- (a-2-2.south east);
\end{tikzpicture}
\end{document}