Python错误集锦:matplotlib legend提示:ValueError: Unrecognized location ‘upper’. Valid locations are
原文链接:http://www.juzicode.com/archives/2486
错误提示:
使用matplotlib legend提示:ValueError: Unrecognized location ‘upper’. Valid locations are
Traceback (most recent call last):File "09-plt-step.py", line 30, in <module>plt.legend(title='参数where:',fontsize='xx-small',loc='upper')File "D:\Python\Python38\lib\site-packages\matplotlib\pyplot.py", line 2738, in legendreturn gca().legend(*args, **kwargs)File "D:\Python\Python38\lib\site-packages\matplotlib\axes\_axes.py", line 417, in legendself.legend_ = mlegend.Legend(self, handles, labels, **kwargs)File "D:\Python\Python38\lib\site-packages\matplotlib\legend.py", line 455, in __init__raise ValueError(
ValueError: Unrecognized location 'upper'. Valid locations arebestupper rightupper leftlower leftlower rightrightcenter leftcenter rightlower centerupper centercenter
可能原因:
1、使用matplotlib的legend图例说明是,说明位置参数loc=’upper’非法,没有’upper’类型的位置值
解决方法:
1、通过错误提示找到合法的位置值,可以使用下面这些字符串表示的位置,比如upper right表示右上角:
bestupper rightupper leftlower leftlower rightrightcenter leftcenter rightlower centerupper centercenter
Python错误集锦:matplotlib legend提示:ValueError: Unrecognized location ‘upper’. Valid locations are相关推荐
- Python错误集锦:python: can’t open file ‘hello’: [Errno 2] No such file or directory
错误提示: 在命令行输入python py文件名称,提示:python: can't open file 'hello': [Errno 2] No such file or directory D: ...
- Python错误集锦:打开文件路径提示参数无效,OSError: [Errno 22] Invalid argument: ‘D:\juzicode\桔子code\readme.txt’
原文链接:http://www.juzicode.com/archives/2493 错误提示: 打开文件路径提示参数无效:OSError: [Errno 22] Invalid argument: ...
- Python错误集锦:pandas读取excel提示ImportError: Missing optional dependency ‘xlrd’.
原文链接:http://www.juzicode.com/archives/3125 错误提示: 用pandas read_excel()方法读取xls或xlsx文件时,提示:ImportError: ...
- Python错误集锦:pandas绘制多个子图时报错:AttributeError: ‘list’ object has no attribute ‘get_figure’
原文链接:http://www.juzicode.com/archives/3273 错误提示: 利用pandas绘制多个子图时报错:AttributeError: 'list' object has ...
- Python花式错误集锦
width="330" height="86" src="//music.163.com/outchain/player?type=3&id= ...
- Python可视化(matplotlib)图像自定义图例(Legend)
Python可视化(matplotlib)图像自定义图例(Legend) 目录 Python可视化(matplotlib)图像自定义图例(Legend) 简单图例
- python plt legend并排,matplotlib Legend 图例用法
matplotLib Legend添加图例:展示数据的信息 用法: legend(): 默认获取各组数据的Label并展示在图框左上角 legend(labels): legend(handles, ...
- python 错误与异常
python 错误与异常 语法错误 异常:大多数的异常都不会被程序处理,都以错误信息的形式展现在这里 异常处理: while True:try:x = int(input("请输入一个错误: ...
- 在Hadoop 2.3上运行C++程序各种疑难杂症(Hadoop Pipes选择、错误集锦、Hadoop2.3编译等)
首记 感觉Hadoop是一个坑,打着大数据最佳解决方案的旗帜到处坑害良民.记得以前看过一篇文章,说1TB以下的数据就不要用Hadoop了,体现不出太大的优势,有时候反而会成为累赘.因此Hadoop的使 ...
最新文章
- Android_CodeWiki_01
- SQL Server 2008 安装问题
- SVM熟练到精通2:SVM目标函数的dual优化推导
- Redis Monitor命令 - 实时打印出Redis服务器接收到的命令,调试用
- HDU 4535 吉哥系列故事——礼尚往来
- python中doc=parased.getroot()_python中执行sed命令操作源文件时出现错误
- 开学季,复旦老师教你玩转“0”“1”浪漫!| 人物志
- 使用WCF实现消息推送
- 计算机声音控制程序,win10电脑利用EarTrumpet音量控制应用程序使用教程 | 专业网吧维护...
- 台式计算机睡眠快捷键,电脑如何设置快捷方式迅速进入睡眠的状态?
- 计算机网络技术人员素质要求,做网络技术员需要学习哪些技能
- 腾讯云服务器放音乐,使用腾讯云函数实现网易云音乐自动打卡签到
- 成都市绿色建筑创建行动实施计划通知
- Purdue, Mathematics Area Examination 学习笔记(1)
- 关于汽车悬挂系统减震控制的进一步研究(自动控制原理课程设计小论文)
- 作为 Gopher, 你知道 Go 的注释即文档应该怎么写吗
- 《大话处理器》相关主题汇总
- TDChat国内ChatGPT镜像网站最新网站入口地址
- C语言_公倍数、最小公倍数_调用函数求最大公因数最小公倍数
- 3D建模布线需要注意哪些?