File:Expinvsqlau GIF.gif
来自testwiki
跳转到导航
跳转到搜索
Expinvsqlau_GIF.gif (800 × 600像素,文件大小:281 KB,MIME类型:image/gif、循环、11帧、11秒)
本文件来自维基共享资源并可能被其他项目使用。 其文件描述页上的描述显示在下面。
摘要
| 描述Expinvsqlau GIF.gif |
English: GIF version to illustrate the Laurent approximation of the function |
| 日期 | |
| 来源 | 自己的作品 |
| 作者 | IkamusumeFan |
Matplotlib (Python)
# Author: Ika, 2013-08-24
import math as m
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
# import matplotlib.animation as animation
def draw_frame(n,filename,line_color):
fig = plt.figure()
plt.axes([0.02,0.13,0.9,0.8])
plt.hold(True)
plt.xlim(-3,3)
plt.ylim(-2,4)
# Set up the spines
ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))
# Set up the label
ax.text(2,3,'N='+str(n),fontsize=24,color=line_color)
Q = []
X = np.arange(-3, 3, 0.001)
# Draw the original function (ORG) curve
ORG = np.exp(-1/(X*X))
a = plt.plot(X, ORG, '-', color='black', lw=4)
Q.append(a)
# Draw the approximation function (APPR) curve
i=1
APPR = 1+(-1)**i*(X**(-2*i))/m.factorial(i)
while (i<n):
i = i+1
APPR = APPR+(-1)**i*(X**(-2*i))/m.factorial(i)
a = plt.plot(X, APPR, '-', color=line_color, lw=4)
Q.append(a)
plt.savefig(filename)
draw_frame(1,'frame01.eps','#b30000')
draw_frame(2,'frame02.eps','#00b300')
draw_frame(3,'frame03.eps','#0000b3')
draw_frame(4,'frame04.eps','#b3b300')
draw_frame(5,'frame05.eps','#00b3b3')
draw_frame(6,'frame06.eps','#b300b3')
draw_frame(7,'frame07.eps','#b3b3b3')
draw_frame(10,'frame08.eps','#3300b3')
draw_frame(50,'frame09.eps','#33b300')
draw_frame(65,'frame10.eps','#0033b3')
draw_frame(80,'frame11.eps','#b3b333')
# To generate the final GIF file, use the shell command:
# convert -antialias -loop 0 -delay 100 -compress LZW frame* Expinvsqlau_GIF.gif
许可协议
我,本作品著作权人,特此采用以下许可协议发表本作品:
本文件采用知识共享署名-相同方式共享 3.0 未本地化版本许可协议授权。
- 您可以自由地:
- 共享 – 复制、发行并传播本作品
- 修改 – 改编作品
- 惟须遵守下列条件:
- 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
- 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
说明
添加一行文字以描述该文件所表现的内容
此文件中描述的项目
描繪內容
某些值没有维基数据项目
26 8 2013
文件历史
点击某个日期/时间查看对应时刻的文件。
| 日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
|---|---|---|---|---|---|
| 当前 | 2013年8月26日 (一) 17:36 | 800 × 600(281 KB) | wikimediacommons>IkamusumeFan | Rescale the image for better display. |
文件用途
以下页面使用本文件:
