茎叶绘图表上的 LaTeX 顶行
我试图使用以下内容在 LaTeX 的表格环境中表示茎叶图:
\begin{table}[htbp]
\centering
\caption{Stem Plot of sit ups, Key: $1 | 1= 1.1$}
\begin{tabular}{r|l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}}
\multirow{2}{*}{} Stem & Leaf \\
\hline
1 & 1 & 1 & 2 & 3 & 3 & 4 & 4 & & \\
1 & 5 & 6 & 6 & 8 & & & & & \\
2 & 0 & 3 & & & & & & & \\
2 & 7 & 8 & & & & & & & \\
3 & & & & & & & & & \\
3 & 5 & 7 & 8 & 8 & & & & & \\
4 & 0 & 0 & 0 & 1 & 2 & 4 & 4 & 4 & \\
4 & 5 & 5 & 6 & 7 & 7 & 7 & 8 & 8 & 9 \\
\end{tabular}
\label{tab:addlabel}
\end{table}
但是当我这样做时,第二列太宽,并且叶值的第二列和第三列之间存在间隙。我怎样才能使“叶”单元重叠到下一列或以某种方式消除间隙?
I am trying to represent a stem and leaf plot in a tabular environment in LaTeX using the following:
\begin{table}[htbp]
\centering
\caption{Stem Plot of sit ups, Key: $1 | 1= 1.1$}
\begin{tabular}{r|l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}}
\multirow{2}{*}{} Stem & Leaf \\
\hline
1 & 1 & 1 & 2 & 3 & 3 & 4 & 4 & & \\
1 & 5 & 6 & 6 & 8 & & & & & \\
2 & 0 & 3 & & & & & & & \\
2 & 7 & 8 & & & & & & & \\
3 & & & & & & & & & \\
3 & 5 & 7 & 8 & 8 & & & & & \\
4 & 0 & 0 & 0 & 1 & 2 & 4 & 4 & 4 & \\
4 & 5 & 5 & 6 & 7 & 7 & 7 & 8 & 8 & 9 \\
\end{tabular}
\label{tab:addlabel}
\end{table}
But when I do this, the 2nd column has is too wide and there is a gap between the 2nd and 3rd column of leaf values. How can I make it so that the 'Leaf' cell overlaps into the next column or somehow remove the gap?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将
Leaf
放入\multicolumn{9}{l}{Leaf}
中。数字(此处为9
)给出了应跨越的列数,l
给出了单元格的格式。顺便说一句,如果您需要右栏,则必须在那里使用l|
。我认为你不需要
\multirow
。You can put
Leaf
into a\multicolumn{9}{l}{Leaf}
. The number (9
here) gives how many columns that should span, thel
gives the formatting of the cell. If you need a right bar, you have to usel|
there, by the way.You do not need the
\multirow
then, I think.\multirow
和\multicolumn
在使用时会以某种方式弄乱第一行。\multirow
and\multicolumn
somehow mess up the first row when used.