From: Mike A. <mba...@wi...> - 2009-10-21 21:50:20
|
Hi, I have a piece of code that creates a plot without warning when using just fill(), but gives a warning when using fill_between() because that function doesn't seem to actually do register values passed to it by the "label" parameter. The warning happens when I try to make a legend after using fill_between(): /cms/sw/python/2.5/lib/python2.5/site-packages/ matplotlib-0.99.1.1_r0-py2.5-linux-x86_64.egg/matplotlib/axes.py:4014: UserWarning: No labeled objects found. Use label='...' kwarg on individual plots. warnings.warn("No labeled objects found. " In essence this code works fine when I use fill() rather than fill_between(): -------------------- for column in sorted(yValues): ax.fill_between(xValues, yValues[column], label=column) legend = plt.legend(bbox_to_anchor=(1.3, 1), shadow=True, fancybox=True) -------------------- That is, the legend finds the labels when I use fill(), but not when I use fill_between(). Why is that? Mike |