Matplotlib Legends not working

后端 未结 4 1327
无人及你
无人及你 2020-12-07 10:51

Ever since upgrading matplotlib I get the following error whenever trying to create a legend:

/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarn         


        
4条回答
  •  误落风尘
    2020-12-07 11:36

    Use the "label" keyword, like so:

    pyplot.plot(x, y, label='x vs. y')
    

    and then add the legend like so:

    pyplot.legend()
    

    The legend will retain line properties like thickness, colours, etc.

提交回复
热议问题