User Tools

Site Tools


Lot-time diagrams in LaTeX

With the package lottimediagram it is possible to create lot-time diagrams in LaTeX. Lot-time diagrams are used to visualize the manufacturing process of lots in a deterministic system. On the horizontal axis time is presented, while on the vertical axis the individual lots are indicated with a lot number, starting from zero.


In the main document, the package lottimediadram has to be invoked. This package uses the additional packages pstricks, multido and calc. The file lottimediagram.sty can be in your path, or else put it in your working directory.

Usage and Syntax

The lottimediagram environment can best be used inside a figure environment. In this way, a caption and a label can be attached to the diagram and it can be referred to.


The lottimediagram environment is instantiated as follows:

\begin{lottimediagram}{number of lots}{width of time axis}


The number of lots is a non-zero natural number. The lots are numbered from zero to number of lots - 1. The width of the time axis also has to be a nonzero natural number.

Axis labels and tick intervals

The axis labels are entered as follows:


Placement of time ticks along the axis can go in user-defined intervals:


Placement of lot numbers along the axis can also be done in user-defined intervals where firstlotnumber is the number of the first lot and interval is the interval between lot numbers which are shown. If the \lotticktinterval command is omitted, the first lot number is 0.

Lots and batches

For individual lots, activities are placed in the diagram using the command:

\lot(lot number)(start time, end time){text}

Lots can be highlighted by using the command \activelot:

\activelot(lot number)(start time, end time)(fillcolor)(fillstyle){text}

in which fillcolor can be black, darkgray, gray, lightgray, white, red, green, blue, cyan, magenta or yellow. The argument fillstyle can be solid, hlines, vlines or crosshatch.

(Note that the options hlines and vlines in fact draw diagonal lines, contrary to one’s expectation.)

Batch processes (activities with more than one lot involved) can be placed with the command:

\batch(first lot number of batch, last lot number of batch)(start time, end time){text}

The text can be rotated 90 degrees counterclockwise by using the command \rotatebatch with the same arguments.

Batches can be highlighted by using the command \activebatch:

\activebatch(first lot number of batch, last lot number of batch)(start time, end time)(fillcolor)(fillstyle){text}

with the same fillcolor and fillstyle options as before.

An activebatch can be used with 90 degrees counterclockwise rotated text using the command \activerotatebatch with the same arguments.

Defining blocks for multiplication

If a collection of activities on (multiple) lots or batches is repetitive, a block can be defined, which can be copied elsewhere in the diagram. Around the repetitive activities, place the command:

(collection of

The defined block can be repeated using the command:

\repeatblock{vertical shift}{horizontal shift}

The argument vertical shift is a positive natural number, while horizontal shift is a real number. Blocks can not be nested.


Placing an annotation near a combination of lots can be done using the command \lotcomb:

\lotcomb(start lot number, end lot number)(annotation time){text}

With this command, an arrow is drawn a little right of the indicated time and the text is placed next to it, 90 degrees rotated counterclockwise.


In Figure 1, an example of a lot-time diagram is given. The diagram was constructed using the following commands:

\timeaxislabel{time [h]}
\lotaxislabel{lot nr.}
\activerotatebatch(6,8)(18,22)(lightgray)(solid){F b3}

Example of lot-time diagram

Stand-alone EPS-file of a lot-time diagram

It might be useful to create a stand-alone EPS-file of the lot-time diagram. The EPS-file can then be included in a LaTeX document or it may appear in a presentation, slides, poster etc. To create a stand-alone EPS-file, a separate .tex-file has to be created, which uses the package pst-eps. The LaTeX document for a simple lot-time diagram could then look like:

\timeaxislabel{time [h]}
\lotaxislabel{lot nr.}

The document is compiled using the standard LaTeX compiler:

latex filename.tex

To process the resulting .dvi-file to an EPS file we use dvips with the -E option:

dvips filename.dvi -E -o

The resulting PostScript file eventually is an Encapsulated PostScript file. So it has to be renamed to eps:

mv filename.eps

The resulting EPS-file can be included in a LaTeX document using the includegraphics command. If necessary, the diagram can be scaled using for example the width= argument. This is very useful for large diagrams that have to fit within the margins of a page (see Figure 2 for a not so useful example):

\caption{Lot-time diagram in EPS-format can be scaled.}\label{example2}

Example of lot-time diagram

Another advantage of using stand-alone EPS-file is the possibility to use PDFLaTeX with lot-time diagrams.

latex/lottime/pstricks.txt · Last modified: Wednesday, 24 November 2010 : 14:22:50 by hat