如何让这些并排的条形图完全可见?

如何让这些并排的条形图完全可见?
\documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13]{scrbook}

\usepackage{pgfplots} 

\begin{document}

\begin{figure}
    \centering
    \begin{tikzpicture}
        \begin{semilogyaxis}[
            symbolic x coords={6, 7, 8, 9},
            xtick=data
          ]
            \addplot[ybar,fill=blue] coordinates {
                (6,   0.046566)
                (7,   0.043182)
                (8,   0.044373)
                (9,   0.045699)
            };
            \addlegendentry{TacoCompile};
            \addplot[ybar,fill=green] coordinates {
                (6,   0.000033)
                (7,   0.000032)
                (8,   0.000033)
                (9,   0.000033)
            };
            \addlegendentry{TacoAssemble};
            \addplot[ybar,fill=red] coordinates {
                (6,   0.000252)
                (7,   0.002509)
                (8,   0.024016)
                (9,   0.304340)
            };
            \addlegendentry{TacoCompute};
        \end{semilogyaxis}
    \end{tikzpicture}
    \caption{Evaluation of tensor-chain-multiplication on 5 tensors}
    \label{fig:tenChainEval}
\end{figure}

\end{document}

失败

编辑:我想让这些条形图并排完全可见。

答案1

您可能希望将其ybar用于轴选项,而不是用于图本身。我也不知道“完全可见”是否指的是图例,我已将其移出。

    \documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13]{scrbook}

\usepackage{pgfplots} 
\pgfplotsset{compat=1.16}
\begin{document}

\begin{figure}
    \centering
    \begin{tikzpicture}
        \begin{semilogyaxis}[ybar,
            symbolic x coords={6, 7, 8, 9},xtick=data, 
            legend style={at={(0.5,1.02)},anchor=south}
          ]
            \addplot[fill=blue] coordinates {
                (6,   0.046566)
                (7,   0.043182)
                (8,   0.044373)
                (9,   0.045699)
            };
            \addlegendentry{TacoCompile};
            \addplot[fill=green] coordinates {
                (6,   0.000033)
                (7,   0.000032)
                (8,   0.000033)
                (9,   0.000033)
            };
            \addlegendentry{TacoAssemble};
            \addplot[fill=red] coordinates {
                (6,   0.000252)
                (7,   0.002509)
                (8,   0.024016)
                (9,   0.304340)
            };
            \addlegendentry{TacoCompute};
        \end{semilogyaxis}
    \end{tikzpicture}
    \caption{Evaluation of tensor-chain-multiplication on 5 tensors}
    \label{fig:tenChainEval}
\end{figure}

\end{document}

在此处输入图片描述

或者朝上的酒吧。

\documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13]{scrbook}

\usepackage{pgfplots} 
\pgfplotsset{compat=1.16}
\begin{document}

\begin{figure}
    \centering
    \begin{tikzpicture}
        \begin{axis}[ybar,ymode=log,log origin=infty,
            symbolic x coords={6, 7, 8, 9},xtick=data, 
            legend style={at={(0.5,1.02)},anchor=south}
          ]
            \addplot[fill=blue] coordinates {
                (6,   0.046566)
                (7,   0.043182)
                (8,   0.044373)
                (9,   0.045699)
            };
            \addlegendentry{TacoCompile};
            \addplot[fill=green] coordinates {
                (6,   0.000033)
                (7,   0.000032)
                (8,   0.000033)
                (9,   0.000033)
            };
            \addlegendentry{TacoAssemble};
            \addplot[fill=red] coordinates {
                (6,   0.000252)
                (7,   0.002509)
                (8,   0.024016)
                (9,   0.304340)
            };
            \addlegendentry{TacoCompute};
        \end{axis}
    \end{tikzpicture}
    \caption{Evaluation of tensor-chain-multiplication on 5 tensors}
    \label{fig:tenChainEval}
\end{figure}

\end{document}

在此处输入图片描述

相关内容