1

I'm using pgfgantt to produce timing diagrams. This works nicely except that time labels are centered on points 0.5 time units too far to the right. Example

\usepackage{pgfgantt}

\begin{document}
\begin{ganttchart}[
    expand chart=\textwidth,
    vgrid=true, hgrid=true,
    canvas/.style={draw=none},
    include title in canvas=false,
    y unit title=0.5cm,
    y unit chart=0.6cm,
    title/.style={draw=none, fill=none},
    title label font=\footnotesize
  ]{0}{14}
  \gantttitlelist{0,...,14}{1}\\
  \ganttbar{$\tau_1$}{0}{0}
  \ganttbar[inline]{}{3}{3} \ganttbar[inline]{}{6}{6}
  \ganttbar[inline]{}{9}{9} \ganttbar[inline]{}{12}{12}
\end{ganttchart}
\end{document}

The labels 0,..,14 should be above the dotted lines.

1 Answer 1

2
\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
    expand chart=\textwidth,
    vgrid=true, hgrid=true,
    canvas/.style={draw=none},
    include title in canvas=false,
    y unit title=0.5cm,
    y unit chart=0.6cm,
    title/.style={draw=none, fill=none},
    title label font=\footnotesize,
    title left shift=-1,
  ]{0}{14}
  \gantttitlelist{0,...,14}{1}\\
  \ganttbar{$\tau_1$}{0}{0}
  \ganttbar[inline]{}{3}{3} \ganttbar[inline]{}{6}{6}
  \ganttbar[inline]{}{9}{9} \ganttbar[inline]{}{12}{12}
\end{ganttchart}
\end{document}

Diagram with numbers and five rectangles

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .