8

I want to visualize the transition from a state A to B by doing different operations x,y,z. I want to achieve something similar like this:

 ________                        ________
|        |   ____ _____ ____    |        |
|        |  |    \     \    \   |        |
|   A    |  |  x  |  y  | z  |  |    B   |
|        |  |____/_____/____/   |        |
|________|                      |________|

I know how to draw this blocks in tikz, but I'm not sure if there is already some existing functionality providing an easy way to do this. I want to remove/add/style blocks in a simple way. I also want to put this in a rounded rectangle:

 __________________
(   \    \    \    )
(___/____/____/____)

A circular chain of arrows would also be nice to have.

If there is no existing solution I'm interested in suggestions how to create a good and reusable solution for this problem.

1
  • Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Jun 5, 2012 at 16:01

2 Answers 2

13

You can use some signal shapes with a null distance node.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains,positioning,shapes.symbols}
\begin{document}
\begin{tikzpicture}
  \tikzset{
    bound/.style={
      draw,
      minimum height=2cm,
      inner sep=1em,
    },
    arrow/.style={
      draw,
      minimum height=1cm,
      inner sep=1em,
      shape=signal,
      signal from=west,
      signal to=east,
      signal pointer angle=110,
    }
  }
  \node[bound] (a) {A};
  \begin{scope}[start chain=transition going right,node distance=-\pgflinewidth]
    \node[arrow,right=1cm of a,on chain] {first};
    \node[arrow,on chain] {second};
    \node[arrow,on chain] {third};
  \end{scope}
  \node[bound,right=1cm of transition-end]{B};
\end{tikzpicture}
\end{document}

enter image description here

12

You can use \usetikzlibrary{shapes,decorations.shapes}

The example of the pgfmanual p.335 is as follows

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,decorations.shapes}

\begin{document}
\begin{tikzpicture}[
decoration={shape backgrounds,shape size=.5cm,shape=signal},
signal from=west, signal to=east,
paint/.style={decorate, draw=#1!50!black, fill=#1!50}]
\draw [help lines] grid (3,2);
\draw [paint=red, decoration={shape sep=.5cm}]
(0,2) -- (3,2);
\draw [paint=green, decoration={shape sep={1cm, between centers}}]
(0,1) -- (3,1);
\draw [paint=blue, decoration={shape sep={1cm, between borders}}]
(0,0) -- (3,0);
\end{tikzpicture}

\end{document}

enter image description here

but I have a problem between two nodes (missing an offset) but I'm sure someone will improve the code below:

\begin{tikzpicture}[
decoration={shape backgrounds,shape size=1cm,shape=signal},
signal from=west, signal to=east,
paint/.style={decorate, draw=#1!50!black, fill=#1!50}]

\node[draw,minimum height=2cm,minimum width=2cm](A)at (0,0) {A};
\node[draw,minimum height=2cm](B)at(5,0){B};
\draw [paint=red, decoration={shape sep=1cm},]
(A)-- (B);
\end{tikzpicture}

enter image description here

You must log in to answer this question.