python - 将 matplotlib 条形图打印到 txt 文件
问题描述
我创建了一个条形图,并希望将其写入 txt 文件。而不是使用 plt.show(),它只是显示一个图像,或者使用 plt.savefig() 保存它,我想将条形图写入我的文件
我目前正在打开我的 txt 文件,并想将我的 marplot 添加到它,如下所示
with open('filename', 'w') as f:
f.write(some lines)
somehow write bar plot here
f.write(some more lines)
解决方案
推荐阅读
- reactjs - 使用 Jest/Enzyme 测试经过身份验证的路由
- git - 恢复 git commad(过滤器分支)?
- laravel - Laravel 命令设置为 digitalocean cron 作业但无法正常工作
- django - django-rest-auth:什么是电子邮件验证,如何让用户正确激活帐户?
- networking - 在某些网络上加载网站,但在其他网络上不加载
- javascript - D3.js 上的日志规模
- html - Flexbox 调整大小和可滚动溢出
- python-3.x - 可选参数 argparse Python 的性质
- excel - IF函数根据多个条件返回不同的值
- python-2.7 - Selenium webdriver - Python 不会点击网站上的按钮