Remove the legend on a matplotlib figure

后端 未结 8 1139
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 19:01

To add a legend to a matplotlib plot, one simply runs legend().

How to remove a legend from a plot?

(The closest I came to this

8条回答
  •  渐次进展
    2020-11-30 19:19

    If you are not using fig and ax plot objects you can do it like so:

    import matplotlib.pyplot as plt
    
    # do plot specifics
    plt.legend('')
    plt.show()
    

提交回复
热议问题