当前位置:网站首页>MATPLOTLIB—fail to allocate bitmap
MATPLOTLIB—fail to allocate bitmap
2022-07-13 18:05:00 【hemengfan1】
MATPLOTLIB—fail to allocate bitmap
尝试过网上提供的解决这种问题的方法,但是改进后依然存在这个问题,这个问题困扰了两三天,记录一下解决方案,希望能给大家带来新思路。
依赖的库版本
python == 3.7.0
matplotlib == 3.4.2
网上提供的解决方法(关闭画图窗口或清除当前图片和坐标轴)
fig, ax = plt.subplots(figsize=(4,2))
plt.xlim(0,1200)
plt.ylim(-1,1)
# """去掉边框"""
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['left'].set_visible(False)
# """去掉坐标轴和坐标"""
plt.xticks([])
plt.yticks([])
plt.plot(i,'blue',linewidth=0.5)
# plt.clf() # Clear the current figure.
# plt.cla() # Clear the current axes.
plt.close('all') # Close a figure window.
存在的问题
程序能够生成图片,但是一次性批量生成很多张图片(eg.4000张),后面部分图片就生成失败,显示 fail to allocate bitmap 。
我的解决方法
explain:应该改不是代码的问题。
尝试更改python的版本。
新的库版本
python == 3.6.13
matplotlib == 3.3.4
总结(解决方法)
1.关闭画图窗口
2.清除当前图片和坐标轴
3.更改python版本
边栏推荐
- 字节测试总监熬夜10天肝出来的测试岗面试秘籍,给你的大厂梦插上翅膀~
- 2021-11-13攻防世界做题记录01MISC
- 2-3树 B树 b+树
- JVM principle and Practice
- Flask基础入门七-Cookie和Session
- unittest一站式学习
- 将一个数分解成多个加数相加的形式
- 《MySQL数据库原理、设计与应用》课后习题及答案 黑马程序员编著
- Leetcode lecture - 1 Sum of two numbers (difficulty: simple)
- Interviewer: let's talk about how you solve the transaction problem in the distributed scenario?
猜你喜欢

攻防世界web

2021-11-7bugku做题记录25——POST

【LeetCode】1217. Play chips

Implementation of hash table linear detection class template

JVM对象创建和内存分配机制

DDD - in my dream, can I let you bully me?

6、 Configuration experiment report of data backup software

三、FreeNas实现SMB共享、FTP搭建实验报告

Multi graph detailed blocking queue - synchronousqueue

【Oracle】在docker中配置Oracle数据库
随机推荐
Node. MySQL operation of JS
Advanced technology management - what is influence
select / poll / epoll 讲解
Chrome realizes automated testing: recording and playback web page actions
2年时间,涨薪20k,从外包手工到测试经理的蜕变...
最长上升子序列 最长公共子序列 最大字段和 最长不重复子串
【Oracle】在docker中配置Oracle数据库
Unity3d~ tank AI (small exercise)
ReentrantLock的公平与非公平核心区别
【LeetCode】933. Recent requests
通俗讲Cookie,Session,Token区别
【LeetCode】307. 区域和检索 - 数组可修改
【LeetCode】380. O (1) time insertion, deletion and acquisition of random elements
滑动窗口详解
丑数
JVM principle and Practice
线程池和生产者消费者模型
【LeetCode】面试题 01.05. 一次编辑
接口测试与接口测试自动化
SAP logon cannot start normally