3

I tried a lot around with setting anchors in the plot, but I couldn't manage to center the plot correctly.

In this example the bounding box of plot and legend gets centered, but I want the plot centered, ignoring the legend.

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
  \centering
    \begin{tikzpicture}
      \begin{axis}[legend pos=outer north east]
      \addplot [domain=0:pi] {sin(deg(x))};
      \addplot [domain=0:pi] {sin(deg(x))};
      \legend{longlonglongplotname, plotname}
    \end{axis}
  \end{tikzpicture}
\end{document}

0 Answers0