需要帮助来减少甘特图中网格的垂直间距。尝试了几次 Y 网格等,但不起作用。希望有人能帮忙!
\begin{center}
\begin{tikzpicture}[y=0.1cm]
\begin{ganttchart}[vgrid,hgrid,title height=.75, title top shift=0]{1}{25}
\ganttset{bar height=0.2}
\gantttitle{Week}{25} \\
\gantttitlelist{1,...,25}{1}\\
\ganttbar{Task 1}{2}{4} \\
\ganttbar{Task 2}{5}{6} \\
\ganttmilestone{M 1}{6} \\
\ganttbar{Task 3}{7}{11}
\ganttlink{elem0}{elem1}
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{tikzpicture}
\end{center}
答案1
欢迎来到 TeX.SE!这里有一个提议。
\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
\begin{center}
\begin{tikzpicture}[/pgfgantt/y unit chart=0.7cm]
\begin{ganttchart}[vgrid,hgrid,title height=.75, title top shift=0]{1}{25}
\ganttset{bar height=0.2}
\gantttitle{Week}{25} \\
\gantttitlelist{1,...,25}{1}\\
\ganttbar{Task 1}{2}{4} \\
\ganttbar{Task 2}{5}{6} \\
\ganttmilestone{M 1}{6} \\
\ganttbar{Task 3}{7}{11}
\ganttlink{elem0}{elem1}
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{tikzpicture}
\end{center}
\end{document}
这就是所谓的最小工作示例(MWE),只需复制和编译即可,使每个人的生活更加轻松。