tikz 中的带有 smartdiagram 的多个序列图和说明性文本

tikz 中的带有 smartdiagram 的多个序列图和说明性文本

我想绘制多个序列图并附加一些解释性文字。

在此处输入图片描述

这是我的最低工作示例代码:

\documentclass{article}

\usepackage[a4paper, landscape, margin=2in]{geometry}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}

\begin{document}

\centering
\smartdiagramset{
    set color list={red!10, red!30,red!50},
    sequence item border color=black,
    sequence item text color=black,
    sequence item border size=1.2\pgflinewidth,
    sequence item font size=\scriptsize\sffamily,
    additions={
        additional item shape = rectangle,
        additional item fill color = colours!!+!20,
        additional item border color = colours!!,
        additional arrow line width = 2pt,
        additional arrow tip = to,
        additional arrow color = black,
        additional item font = \scriptsize\sffamily,
      }
}

\smartdiagramadd[sequence diagram]{A1, B1, C1, D1, E1, F1, G1, H1}
{
above of sequence-item1/Step 1,
above of sequence-item2/Step 2,
above of sequence-item3/Step 3,
above of sequence-item4/Step 4,
above of sequence-item5/Step 5,
above of sequence-item6/Step 6,
above of sequence-item7/Step 7,
above of sequence-item8/Step 8
}


\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{to-}{sequence-item2/additional-module2}
\smartdiagramconnect{to-}{sequence-item3/additional-module3}
\smartdiagramconnect{to-}{sequence-item4/additional-module4}
\smartdiagramconnect{to-}{sequence-item5/additional-module5}
\smartdiagramconnect{to-}{sequence-item6/additional-module6}
\smartdiagramconnect{to-}{sequence-item7/additional-module7}
\smartdiagramconnect{to-}{sequence-item8/additional-module8}

\smartdiagram[sequence diagram]{A2, B2, C2, D2, E2, F2, G2, H2}

\smartdiagram[sequence diagram]{A3, B3, C3, D3, E3, F3, G3, H3}

\begin{tikzpicture}[overlay]
    \node[left = of module1, xshift = -90mm, yshift = 45mm] {C 1};
    \node[left = of module1, xshift = -90mm, yshift = 27mm] {C 2};
    \node[left = of module1, xshift = -90mm, yshift = 12mm] {C 3};
    
\end{tikzpicture}

\end{document}

问题

  1. 第一个和第二个序列图之间的空间以及第二个和第三个序列图之间的空间不一样。
  2. 增加第一个序列图与其上方框中的解释性文字之间的距离。
  3. 将文本放入1 号碳2碳3在盒子里。
  4. 如何仅更改特定序列图的单个或多个项目的颜色。

答案1

  1. 第一个和第二个序列图之间的空间以及第二个和第三个序列图之间的空间不一样。

latex 中的空行表示新段落。在智能图表之间添加的空行越多,空间就越大。

  1. 增加第一个序列图与其上方框中的解释性文字之间的距离。

您可以使用以下方式更改间距additional item offset

  1. 将文本(如 C 1、C 2 和 C 3)放入框中。

您已将框放在图表上方。您可以使用相同的技术将框放在图表前面。

  1. 如何仅更改特定序列图的单个或多个项目的颜色。

您正在对 中的颜色列表进行硬编码set color list。如果您想更改一种或多种颜色,请在那里进行更改。

\documentclass{article}

\usepackage[a4paper, landscape, margin=2in]{geometry}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}

\begin{document}

\centering
\smartdiagramset{
    set color list={red!10, red!30,red!50},
    sequence item border color=black,
    sequence item text color=black,
    sequence item border size=1.2\pgflinewidth,
    sequence item font size=\scriptsize\sffamily,
    additions={
        additional item shape = rectangle,
        additional item fill color = colours!!+!20,
        additional item border color = colours!!,
        additional arrow line width = 2pt,
        additional arrow tip = to,
        additional arrow color = black,
        additional item font = \scriptsize\sffamily,
        additional item offset = 1cm,
      }
}

\smartdiagramset{set color list={black!50, red!30,red!50}}
\smartdiagramadd[sequence diagram]{A1, B1, C1, D1, E1, F1, G1, H1}
{
above of sequence-item1/Step 1,
above of sequence-item2/Step 2,
above of sequence-item3/Step 3,
above of sequence-item4/Step 4,
above of sequence-item5/Step 5,
above of sequence-item6/Step 6,
above of sequence-item7/Step 7,
above of sequence-item8/Step 8,
left of sequence-item1/C1
}
\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{to-}{sequence-item2/additional-module2}
\smartdiagramconnect{to-}{sequence-item3/additional-module3}
\smartdiagramconnect{to-}{sequence-item4/additional-module4}
\smartdiagramconnect{to-}{sequence-item5/additional-module5}
\smartdiagramconnect{to-}{sequence-item6/additional-module6}
\smartdiagramconnect{to-}{sequence-item7/additional-module7}
\smartdiagramconnect{to-}{sequence-item8/additional-module8}
\smartdiagramset{set color list={red!20, red!30,red!50,green!40,orange!40,black!50,black!50,black!50}}
\smartdiagramadd[sequence diagram]{A2, B2, C2, D2, E2, F2, G2, H2}{left of sequence-item1/C2}
\smartdiagramset{set color list={red!20, red!30,red!50,green!40,orange!40,yellow!40,magenta!40,brown!40}}
\smartdiagramadd[sequence diagram]{A3, B3, C3, D3, E3, F3, G3, H3}{left of sequence-item1/C3}


\end{document}

在此处输入图片描述

答案2

\documentclass[a4paper,12pt]{article}
\usepackage{smartdiagram}
\usepackage{geometry}


\begin{document}
\begin{center}
\smartdiagram[sequence diagram]{Adgg,Bdgg,Cdgdg,Dgdg,Effdf,Fhgh}
\end{center}
\end{document}

在此处输入图片描述

相关内容