[Matplotlib-users] facecolor for legend with alpha and shadow

Paul Hobson pmhobson at gmail.com
Tue May 15 13:29:37 EDT 2018


Jon,

I think with the transparent legend face, you're seeing the dark shadow
underneath it. This seems to be reflected when changing the alpha
values.The shadow itself if is a polygon the same size of the legend,
z-ordered below the legend itself, and offset slightly.

Does that explain this to you?
-Paul

On Tue, May 15, 2018 at 7:07 AM, Slavin, Jonathan <jslavin at cfa.harvard.edu>
wrote:

> Hi all,
>
> I'm wondering why using shadow=True causes shading of the legend box when
> framealpha is set to a number.  That is, if I do:
> fig,ax = plt.subplots()
> ax.plot(x,y1,label='y1')
> ax.plot(x,y2,label='y2')
> ax.legend(framealpha=0.5,shadow=True)
>
> The face color of the legend is gray.  There doesn't seem to be any reason
> for this, so I'm assuming it's a bug.  I've been looking through the docs
> and haven't found anything relevant - and haven't found any way around it
> other than turning off the shadow. Any help would be appreciated.
>
> Regards,
> Jon
>
> --
> ________________________________________________________
> Jonathan D. Slavin                 Harvard-Smithsonian CfA
> jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> cell: (781) 363-0035             USA
> ________________________________________________________
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180515/280a09aa/attachment.html>


More information about the Matplotlib-users mailing list