From: John H. <jdh...@ac...> - 2004-10-12 14:12:25
|
>>>>> "BDayton" == BDayton <BD...@co...> writes: BDayton> Hi, 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): with 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? Cheers, JDH |