[Tex/LaTex] How to Center Forest Diagram as a Whole

foresthorizontal alignment

Does anybody know how to center the diagram drawn by the package 'forest', as a whole?
I tried putting the forest inside of a float along with \centering and it worked, but I was wondering if there is an alternative way of achieving it.

\documentclass[a4paper]{scrartcl}
\usepackage{forest}
\usepackage{showframe}

\begin{document}
\begin{figure}
  \centering
    \begin{forest}
      for tree={align=center}
      [opencv\_storage
        [cascade
          [height]
          [width]
          [stageNum]
          [stages
            [\textbf{\_}
              [maxWeakCount]
              [stageSthreshold]
              [weakClassifier
                [\textbf{\_}
                  [internalNodes]
                  [leafValues]
                ]
              ]
            ]
          ]
          [...]
          [features
            [\textbf{\_}
              [rects
                [\textbf{\_}]
              ] 
            ]
          ]
        ]
      ]
    \end{forest}
  \end{figure}  

\end{document}

Best Answer

There's no need to put the diagram in a floating environment. You can instead wrap it in a \begin{center} ... \end{center} environment.

Related Question