python - ConversionError:无法将值转换为轴单位:Python matplotlib
问题描述
我想格式化 y 轴上的数字,使它们看起来像美元金额?例如 200 美元而不是 200 美元。
ticks = graph.get_yticks()
labels=['${}'.format(int(amt)) for amt in ticks]
graph.set_yticks(labels)
低于错误。在此先感谢。
ConversionError: Failed to convert value(s) to axis units: ['$125', '$150', '$175', '$200', '$225', '$250', '$275', '$300', '$325']
解决方案
推荐阅读
- angular - 以角度 4 阻止多个文件选择和上传
- gnuplot - 如何在gnuplot中以指定间隔显示标记?
- python - 如何将传感器读数从 raspi 存储到我的数据库中?
- android - Android GeoLocation FireStore:一种在用户关闭位置共享选项后阻止谷歌服务获取用户地理点的方法
- angular - Angular 5 ngx-toastr 不显示 html 消息
- excel - 如何匹配来自多个数据集的多行?
- apache-kafka - 卡夫卡授权
- laravel - 如何将 laravel 项目上传到共享主机 cpanel 子域?
- botframework - 如何获取通道的响应和请求详细信息?
- python - Iris Dataset - 机器学习分类模型