已解决No handles with labels found to put in legend

耳一文

关注

阅读 37

2023-09-22


已解决No handles with labels found to put in legend

已解决No handles with labels found to put in legend_解决方法


文章目录

  • 报错问题
  • 解决方法
  • PS


报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

No handles with labels found to put in legend

matplotlib.pyplot .plot 时,没有设置参数label=“xx”

已解决No handles with labels found to put in legend_python_02

解决方法

已解决No handles with labels found to put in legend_matplotlib_03

import matplotlib.pyplot as plt
 plt.plot(x, y label=‘上海’)

PS

有问题评论区留言即可


精彩评论(0)

0 0 举报