跳至內容

File:Curve fitting.svg

頁面內容不支援其他語言。
這個檔案來自維基共享資源
維基百科,自由的百科全書

原始檔案(SVG 檔案,表面大小:512 × 384 像素,檔案大小:23 KB)


摘要

描述
English: This graph shows a series of points (generated by a Sin function) approximated by polinomial curves (red curve is linear, green is quadratic, orange is cubic and blue is 4th degree).
Italiano: Il grafo mostra una serie di punti (generati dalla funzione seno) approssimati da curve polinomiali (in rosso di primo grado, verde di secondo, arancione di terzo e verde di quarto.
日期
來源 自己的作品
作者 Krishnavedala
其他版本 File:Curve fitting.jpg
 
W3C-validity not checked.
GNU Octave source code
x = 1:1.5:100;
y = sin(x/10);
p1 = polyfit(x,y,1);
p2 = polyfit(x,y,2);
p4 = polyfit(x,y,4);
p3 = polyfit(x,y,3);
figure;
plot(x,y,'k.'); hold all
plot(x,polyval(p1,x),'r');
plot(x,polyval(p2,x),'g');
plot(x,polyval(p3,x),'color',[1 .5 0]);
plot(x,polyval(p4,x),'b');
grid on
set (gca,'xaxislocation','zero')
set (gca,'yaxislocation','zero')
box off
print('Curve fitting.svg')
Python source Code

Created using python with numpy and matplotlib toolboxes.

from numpy import *
from matplotlib.pyplot import *
from mpl_toolkits.axes_grid.axislines import SubplotZero

x = linspace(0,100,75)
y = sin(2.*pi*x/60.+.4)

y1 = poly1d(polyfit(x,y,1))	# linear
y2 = poly1d(polyfit(x,y,2))	# quadratic
y3 = poly1d(polyfit(x,y,3))	# cubic
y4 = poly1d(polyfit(x,y,4))	# 4th degree

fig = figure(figsize=(6,4))
ax = SubplotZero(fig,111)
fig.add_subplot(ax)
ax.grid(True)

ax.plot(x,y1(x),'r',label=u'linear')
ax.plot(x,y2(x),'g',label=u'quadratic')
ax.plot(x,y3(x),'orange',label=u'cubic')
ax.plot(x,y4(x),'b',label=u'$4^{th}$ order')
ax.plot(x,y,'k.',label=u'data')

ax.set_xlabel(u'x')
ax.set_ylabel(u'y')
ax.minorticks_on()
ax.legend(frameon=False,loc=4,labelspacing=.2)

setp(ax.get_legend().get_texts(), fontsize='small')

fig.savefig("Curve fitting.svg",bbox_inches="tight",pad_inches=.15)

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
Creative Commons CC-Zero 此檔案在創用CC CC0 1.0 通用公有領域貢獻宣告之下分發。
在此宣告之下分發本作品者,已依據各國著作權法,在全世界放棄其對本作品所擁有的著作權及所有相關相似的法律權利,從而將本作品貢獻至公有領域。您可以複製、修改、分發和演示該作品,用於任何商業用途,所有這些都不需要請求授權。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

image/svg+xml

13c46724a90867f5da1a8a488188185038585a28

斷定方法:​SHA-1 中文 (已轉換拼寫)

23,160 位元組

384 像素

512 像素

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸使用者備⁠註
目前2014年10月1日 (三) 18:05於 2014年10月1日 (三) 18:05 版本的縮圖512 × 384(23 KB)Krishnavedalare-created using w:GNU Octave
2011年9月7日 (三) 00:32於 2011年9月7日 (三) 00:32 版本的縮圖514 × 351(117 KB)Krishnavedala{{Information |Description ={{en|1=This graph shows a series of points (generated by a Sin function) approximated by polinomial curves (red curve is linear, green is quadratic, orange is cubic and blue is 4th degree).}} {{it|1=Il grafo mostra una serie

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案:

詮釋資料