pgfgantt 还很新。有人能告诉我如何用 $x$ 轴表示时间吗?从图表顶部到底部?
梅威瑟:
\documentclass[16pt]{article}
\usepackage{pgfgantt}
\usepackage[dvipsnames]{xcolor}
\newcommand{\OG}{\color{OliveGreen}}
\newcommand{\vio}{\color{Violet}}
\begin{document}
\begin{figure}[H]
\centering
\begin{ganttchart}[inline, x unit = 1cm]{0}{12}
\gantttitle{Time}{13}\\
\gantttitlelist{0,...,12}{1} \\
\ganttbar[inline=false]{\LG $M_1$}{1}{1}
\ganttbar{\vio $J_3$}{0}{1}
\ganttbar{\vio $J_4$}{3}{5}
\ganttbar{\vio $J_2$}{6}{9}
\ganttbar{\vio $J_1$}{10}{11}
\end{ganttchart}
\end{figure}
\end{document}
理想情况下,我希望它更像这张 tikz 图片:
但也有 x-ticks。
感谢大家!