26

The legend box is covering parts of the graph (even though I removed the borders). How do I make the legend box transparent?

enter image description here

1 Answer 1

43

You can add fill=none to the legend style key as in this approach.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}

\pgfplotsset{compat=1.9}

\begin{document}
  \begin{tikzpicture}
    \begin{axis}[
      legend style={fill=none}
    ]
      \addplot {x};
      \addlegendentry{$x$};
    \end{axis}
  \end{tikzpicture}
\end{document}

enter image description here

2
  • Repositioning the legend or decrease of its font size could also be an option. Mar 4, 2014 at 16:33
  • Thank you, works like a charm. No need to reposition or decrease font size now! Mar 4, 2014 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .