>>>>> "BDayton" == BDayton <BDayton@...> writes:
BDayton> I have produced a figure and used 'fill' to plot regions
BDayton> in that figure. I wanted to place a legend for it, but
BDayton> when I tried it only the labels appeared - no coloured
BDayton> squares indicating the colours of the fills, as you get
BDayton> in Matlab. Is it possible to do this? I noticed in one of
BDayton> the example scripts that it works with a barchart. I
BDayton> would like to use it in the same way, but with 'fill's.
In matplotlib/legend.py, on line 182, try replacing
elif isinstance(handle, Rectangle):
elif isinstance(handle, Patch):
and try again. If it fails, please send in an example script that
exposes the problem, but let me know in any case. Note this solution
will still draw a little rectangle in the legend rather than a
miniature polygon the same shape as the fill one, but it will
otherwise have the same properties (eg facecolor). What does matlab do?