Takuya Miyashita
This site
Web
Start:
*Python演習問題:等高線図とベクトル図 [#wb10cce6]
***インポート・エイリアス設定 [#ec330942]
いつも通り.
#codeprettify(lang-python){{
import numpy as np
import matplotlib.pyplot as plt
}}
***問題 [#edce4580]
+[[最大値・最小値の検出>../演習:最大値・最小値の検出]]で...
#codeprettify(lang-python){{
from XXX import peaks
if __name__ == '__main__':
}}
+peaksを使って等高線図(コンター)を作成しなさい.座標軸の...
#codeprettify(lang-python){{
#オブジェクト指向らしく
fig = plt.figure()
ax = fig.add_subplot(111)
ax.contour()
ax.set_xlael()
ax.set_ylabel()
# MATLABっぽく
plt.contour()
plt.xlabel()
plt.ylabel()
}}
+上記のデータから勾配を求め,等高線図の上にオーバーラップ...
#codeprettify(lang-python){{
Fx, Fy = np.gradient(F)
# オブジェクト指向らしく
ax.quiver(...)
ax.quiverkey(...)
ax.axis(...)
# MATLABっぽく
plt.quiver(...)
plt_quiverkey(...,labelpos='E')
plt.axis(...)
}}
+peaksを使って塗り潰しコンター図を作成しなさい.コンター...
#codeprettify(lang-python){{
C = ax.contourf(xxx,extend='both')
Q = ax.quiver(xxx)
ax.quiverkey(Q,...)
fig.colorbar(C,...)
}}
+3,4の図をpng,eps形式で保存し,ファイルの大きさを比べな...
#codeprettify(lang-python){{
fig.savefig('filename',format='hoge',dpi=num)
plt.savefig('filename',format='hoge',dpi=num)
}}
***解答例(参考) [#te606a72]
塗りつぶしコンターは微妙な見栄え.~
&ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/i...
&ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/i...
End:
*Python演習問題:等高線図とベクトル図 [#wb10cce6]
***インポート・エイリアス設定 [#ec330942]
いつも通り.
#codeprettify(lang-python){{
import numpy as np
import matplotlib.pyplot as plt
}}
***問題 [#edce4580]
+[[最大値・最小値の検出>../演習:最大値・最小値の検出]]で...
#codeprettify(lang-python){{
from XXX import peaks
if __name__ == '__main__':
}}
+peaksを使って等高線図(コンター)を作成しなさい.座標軸の...
#codeprettify(lang-python){{
#オブジェクト指向らしく
fig = plt.figure()
ax = fig.add_subplot(111)
ax.contour()
ax.set_xlael()
ax.set_ylabel()
# MATLABっぽく
plt.contour()
plt.xlabel()
plt.ylabel()
}}
+上記のデータから勾配を求め,等高線図の上にオーバーラップ...
#codeprettify(lang-python){{
Fx, Fy = np.gradient(F)
# オブジェクト指向らしく
ax.quiver(...)
ax.quiverkey(...)
ax.axis(...)
# MATLABっぽく
plt.quiver(...)
plt_quiverkey(...,labelpos='E')
plt.axis(...)
}}
+peaksを使って塗り潰しコンター図を作成しなさい.コンター...
#codeprettify(lang-python){{
C = ax.contourf(xxx,extend='both')
Q = ax.quiver(xxx)
ax.quiverkey(Q,...)
fig.colorbar(C,...)
}}
+3,4の図をpng,eps形式で保存し,ファイルの大きさを比べな...
#codeprettify(lang-python){{
fig.savefig('filename',format='hoge',dpi=num)
plt.savefig('filename',format='hoge',dpi=num)
}}
***解答例(参考) [#te606a72]
塗りつぶしコンターは微妙な見栄え.~
&ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/i...
&ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/i...
Page:
Edit with a page name which already exists