目录
解决问题
1. 2. No handles with labels found to put in legend. 3. 4. Traceback (most recent call last): 5. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py", line 508, in _draw_idle 6. self.draw() 7. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 388, in draw 8. self.figure.draw(self.renderer) 9. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 10. return draw(artist, renderer, *args, **kwargs) 11. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1709, in draw 12. renderer, self, artists, self.suppressComposite) 13. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images 14. a.draw(renderer) 15. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 16. return draw(artist, renderer, *args, **kwargs) 17. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2647, in draw 18. mimage._draw_list_compositing_images(renderer, self, artists) 19. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images 20. a.draw(renderer) 21. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 22. return draw(artist, renderer, *args, **kwargs) 23. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 670, in draw 24. bbox, info, descent = textobj._get_layout(renderer) 25. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 276, in _get_layout 26. key = self.get_prop_tup(renderer=renderer) 27. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 831, in get_prop_tup 28. x, y = self.get_unitless_position() 29. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 813, in get_unitless_position 30. x = float(self.convert_xunits(self._x)) 31. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 180, in convert_xunits 32. return ax.xaxis.convert_units(x) 33. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1553, in convert_units 34. f'units: {x!r}') from e 35. matplotlib.units.ConversionError: Failed to convert value(s) to axis units: 'LiR' 36. Traceback (most recent call last): 37. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1550, in convert_units 38. ret = self.converter.convert(x, self.units, self) 39. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\category.py", line 52, in convert 40. 'Missing category information for StrCategoryConverter; ' 41. ValueError: Missing category information for StrCategoryConverter; this might be caused by unintendedly mixing categorical and numeric data 42. The above exception was the direct cause of the following exception: 43. Traceback (most recent call last): 44. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py", line 508, in _draw_idle 45. self.draw() 46. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 388, in draw 47. self.figure.draw(self.renderer) 48. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 49. return draw(artist, renderer, *args, **kwargs) 50. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1709, in draw 51. renderer, self, artists, self.suppressComposite) 52. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images 53. a.draw(renderer) 54. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 55. return draw(artist, renderer, *args, **kwargs) 56. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2647, in draw 57. mimage._draw_list_compositing_images(renderer, self, artists) 58. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images 59. a.draw(renderer) 60. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper 61. return draw(artist, renderer, *args, **kwargs) 62. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 670, in draw 63. bbox, info, descent = textobj._get_layout(renderer) 64. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 276, in _get_layout 65. key = self.get_prop_tup(renderer=renderer) 66. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 831, in get_prop_tup 67. x, y = self.get_unitless_position() 68. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\text.py", line 813, in get_unitless_position 69. x = float(self.convert_xunits(self._x)) 70. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py", line 180, in convert_xunits 71. return ax.xaxis.convert_units(x) 72. File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1553, in convert_units 73. f'units: {x!r}') from e 74. matplotlib.units.ConversionError: Failed to convert value(s) to axis units: 'LiR'
解决思路
matplotlib.units.Conversion错误:未能将值转换为轴单元:'LiR'
解决方法
matplotlib版本较低,将matplotlib库,更新至3.3.2版本以上即可!
文章知识点与官方知识档案匹配,可进一步学习相关知识