I am currently drawing a timing diagramm and need to change the signal heigth of one signal. Is there a mechanism in tikz timing to do so?
This is my timing diagramm/ my minimal example:
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-timing}
\begin{document}
\scalebox{1.5}{%
\begin{tikztimingtable}
clk & 29{c} \\
data\_in & 0.1l [[timing/slope=0.7]]hhhhllllllhhhhhlllll 0.4lhhhhlllll\\
error & lllhhhhhhhhllhhhhhhh hllhhhhhh\\
error\_reg & lllllhhhhhhhhllhhhhh hhhllhhhh\\
data & lhhhhhhllllhhhhhhlll lllhhhhll\\
data\_reg & lllhhhhhhllllhhhhhhl lllllhhhh\\
early & lllllllllllhhlllllll lllllllll\\
late & llllllllllllllllllll lllhhllll\\
\extracode
\makeatletter
\begin{pgfonlayer}{background}
\begin{scope}[gray,semitransparent,semithick]
\foreach \x in {0.5,...,14.5}
\draw (\x,1) -- (\x,-14);
\draw(0,-1.1) -- (16,-1.1);
\draw(0,-1.9) -- (16,-1.9);
\node [anchor=south east,inner sep=0pt]
at (18,-1.4) {\tiny Vrefp};
\node [anchor= south east,inner sep=0pt]
at (18,-2.2) {\tiny Vrefn};
\end{scope}
\end{pgfonlayer}
\end{tikztimingtable}
}%
\end{document}
The output looks like this, I want the data_in signal twice as high but all other signals should stay as they are:
Best Answer
Here I use
y=2\yunit
to double the height of thedata\_in
row as desired.The tricky part is handling the spacing. The problem is that by the time the next row is created (using the internal representation of
rowdist
as a skip amount), any key settings done in the previous row are out of scope.Conversely, by the time the key settings in the current row are executed, the current row has already been placed with the old
rowdist
, which gives the wrong spacing.In this solution, I use a global key setting macro
\gtikzset
as defined in the accepted answer to How to globally tikzset styles. This is used to globally settiming/rowdist=3
at the end of the first row, which causes the second row to be created at the right spot. Then, at the beginning of the second row, I globally reset it to the original value,timing/rowdist=2
which holds for the rest of the table.Other notes about your code:
\vertlines
is provided bytikz-timing
to place vertical grid lines, it can replace your\foreach
loop for those.Instead of manually positioning your annotations, you can use the named nodes provided by
tikz-timing
so you don't have to update them whenever the drawing changes. Sobecomes
where I have also specified
\tiny
as thefont
key within the scope.Here's the complete code:
And the result: