python运行提示显卡内存不足_在Python绘图中如何避免内存不足?

要绘制大量相似的对象,必须使用不同的matplotlib.collections类之一——唉,它们的用法有点神秘,至少在我的理解中是这样的。。。在$ cat ellipses.py

import numpy as np

import matplotlib.pyplot as plt

from matplotlib.collections import EllipseCollection

N = 10**5

# centres of ellipses — uniform distribution, -5<=x<5, -3<=y<3

xy = np.random.random((N,2))*np.array((5*2,3*2))-np.array((5,3))

# width, height of ellipses

w, h = np.random.random(N)/10, np.random.random(N)/10

# rotation angles, anticlockwise

a = np.random.random(N)*180-90

# we need an axes object for the correct scaling of the ellipses

fig, ax = plt.subplots()

# create the collection

ec = EllipseCollection(w, h, a,

units='x',

offsets=xy,

transOffset=ax.transData)

ax.add_collection(ec)

ax.autoscale(tight=True)

plt.savefig('el10^5.png')

我把它记在我的低端笔记本上

^{pr2}$

如您所见,当您对每个地块所需的分期付款进行折扣时,大约需要

5秒-结果是什么?在

我认为关于偏心率和角度的细节在如此密集的描述中丢失了,但是我不知道你的任务的具体细节,也不会进一步评论。在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值