Tikz-timing 中的任意颜色数据单元?

Tikz-timing 中的任意颜色数据单元?

平均能量损失

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-timing}
\begin{document}
\begin{tikztimingtable}[
scale=2.5,
timing/slope=0.1,
timing/rowdist=3ex,
]
 \textnormal{Data}  & U 2D{Start}2D{B0}2D{B1}2D{B2}2D{B3}2D{B4}2D{B5}2D{B6}2D{B7}2D{Parity}2D{Stop}2D{Stop}U{ } \\
\extracode
\begin{pgfonlayer}{background}
\vertlines[help lines,red]{0,1,3,5,7,9,11,13,15,17,19,21,23}
\end{pgfonlayer}
\tablegrid[green!25,step=1]
\end{tikztimingtable}
\end{document}

我想要输出 在此处输入图片描述

有解决办法吗?

答案1

当然有:使用[fill=<color>]语法:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-timing}
\begin{document}
\begin{tikztimingtable}[
scale=2.5,
timing/slope=0.1,
timing/rowdist=3ex,
]
 \textnormal{Data}  & U [fill=green]2D{Start}[fill=yellow]2D{B0}2D{B1}2D{B2}2D{B3}2D{B4}2D{B5}2D{B6}2D{B7}[fill=magenta!60]2D{Parity}[fill=red!70]2D{Stop}2D{Stop}[fill=gray]U{ } \\
\extracode
\begin{pgfonlayer}{background}
\vertlines[help lines,red]{0,1,3,5,7,9,11,13,15,17,19,21,23}
\end{pgfonlayer}
\tablegrid[fill=red,green!25,step=1]
\end{tikztimingtable}
\end{document}

结果:

在此处输入图片描述

相关内容