11,491 views
この記事は最終更新から 2066日 が経過しています。
import numpy as np import matplotlib.pyplot as plt # ランダムに点をプロット x = np.random.randint(1,5,5) y = np.random.randint(1,5,5) # matplotlibの描画オブジェクト#1を作成 ax1 = plt.subplot(1,2,1) # 散布図を作成 ax1.scatter(x,y) ax1.axis([0,10,0,10]) ax1.grid(True) # 極座標に変換 radii = np.sqrt(x**2 + y**2) theta = np.arctan2(y,x) # matplotlibの描画オブジェクト#2を作成 ax2 = plt.subplot(1,2,2,polar=True) # 散布図を作成 ax2.scatter(theta,radii) ax2.set_rmax(10) ax2.grid(True) # 表示を実行 plt.show()
アクセス数(直近5日): ※試験運用中、BOT除外簡易実装済2025-06-15: 0回 2025-06-14: 0回 2025-06-13: 2回 2025-06-12: 2回 2025-06-11: 2回