I'm encountering unexpected behavior when using xbar interval or ybar interval plot styles with pgfplots.
When I use the option draw=none, I expect no border to appear around the bars, including in the legend. However, a border still appears in the legend (see the blue borders in the example below), even though it is suppressed in the plot itself.
Looking for the definitions of the legend image code is not helping much...
/pgfplots/xbar interval legend/.style={ /pgfplots/legend image code/.code={ \draw [##1,/tikz/.cd,yshift=-0.2em,bar interval width=0.7,bar interval shift=0.5] plot coordinates {(0cm,0.8em) (5pt,0.6em) (10pt,0.6em)}; }, }, I don't know if I am missusing xbar interval or if it is a bug in pgfplots. Interestingly, adding draw opacity=0 does prevent the borders from showing up in the legend. Possibly related to Unexpected borders on legends of stacked bars in pgfplots.
Here is a MWE :
\documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ybar interval, legend entries={A legend}] \addplot+[fill=red!50!white, draw=none, % draw opacity=0, ] coordinates {(0,2) (0.1,1) (0.3,0.5) (0.35,4) (0.5,3) (0.6,2) (0.7,1.5) (1,1.5)}; \end{axis} \end{tikzpicture} \end{document} 
