TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to draw a diagram for packets scheduling in networks similar to the this one:

enter image description here

The same type of diagram (or very similar) can be used also for tasks scheduling.

Can you please indicate a template for this? Or a resource I could use.

Thanks a lot. The copyright for the image belongs to the authors from here.

share|improve this question
Do you know about the pgfgantt package? See ctan.org/pkg/pgfgantt . This package typesets Gantt charts. – Yori May 27 '12 at 17:21
knulp created a task diagram package. Check this: tex.stackexchange.com/questions/29679/pdflatex-and-pstricks – user22273 Nov 18 '12 at 17:32
up vote 0 down vote accepted

sketch of an incomplete solution, to optimize



\begin{tikzpicture}[xscale=1,transform shape]

\draw [-latex](-0.5,0) coordinate(dd)-- (0,0) coordinate (O1) -- (17,0)coordinate(ff) node[above]{$t$};
\draw [dashed,thick] (O1) -- (0,1) coordinate(S3) -- (0,3) coordinate(S2) -- (0,5) coordinate(e3) -- ++(0,1)coordinate(ff2);

\foreach \nn in{S3,S2,e3}{
\draw [thick] (dd|-\nn) node[above]{\nn}-- (\nn-|ff);

\foreach \xx in{1,2,...,16}{
\draw[dashed] (\xx,0) -- (\xx,0|- ff2);

\foreach \xx in{0,4,8,...,16}{
\draw[dashed] (\xx,0.2) -- (\xx,-0.2) node[below]{\xx 0};

\node[ above right=0.4cm and 0cm of e3,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n3a) {$3=f(e_3)$};
\draw[-latex,thick] (n3a.north west) -- ++(0,0.5)node[right]{$a^{e3}_{3=f(e3)}$};

\coordinate(O2) at (2,0);
\node[ above right=0.4cm and 0cm of O2,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n4a) {$4=f(s_2)$};
\draw[-latex,thick,green] (n4a.north west) -- ++(0,0.5)node[right,fill=white]{$a^{S2}_{f(S2)}$};
\draw[-latex,thick,blue] ([xshift=2.7cm]n4a.north west) coordinate(bb1)-- ++(0,0.5)node[right,fill=white]{$a^{S2}_{3=f(e3)}$};
\draw[dashed,red] (n3a.south east) -- (bb1);
\node[right=0cm of n4a,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n3b) {$3=p(e_3)$};

\coordinate(O3) at (0.5,0);
\node[ above right=0.4cm and 0cm of O3,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n1) {$1=f(s_2)$};
\node[right=0cm of n1,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n5) {$5$};
\node[right=0cm of n5,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n4b) {$4=p(S2)$};
\node[right=0cm of n4b,right,draw, minimum width=4cm,minimum height=0.8cm,fill=white](n3c) {$3$};



enter image description here

share|improve this answer
Thank you very much! – ovdsrn May 28 '12 at 15:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.