#64 Area Legend contains draw even though draw=none is given.

open
nobody
None
5
2016-10-18
2013-02-28
Anonymous
No

For reference, check http://tex.stackexchange.com/q/99861/16595

Somehow, even though draw=none is set, the rectangle in the legend image is drawn in black.

Changing the legend image code to use \fill instead of \draw does work though, this still seems like a bug as draw=none normally disables a \draw in TikZ.

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
%\pgfplotsset{
% /pgfplots/area legend/.style={%
% /pgfplots/legend image code/.code={%
% \fill[##1] (0cm,-0.1cm) rectangle (0.6cm,0.1cm);
% }%
% },
%}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
area legend,
domain=0:1,
xmin=0,
legend style={at={(0.03,0.97)},anchor=north west},
axis on top]
\addplot[
fill=blue,
draw=none,
samples=500] {sqrt(x)} \closedcycle;
\legend{$\sqrt x$,$x^2$,$x$}
\end{axis}
\end{tikzpicture}
\end{document}

Discussion

  • Stefan Pinnow

    Stefan Pinnow - 2015-11-22

    still open with 2015-11-22 Revision 1.12.1-92-ge3c6f9d

     
  • Christian Feuersänger

    Looks like a duplicate, yes

     

Log in to post a comment.