サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
WWDC25
qiita.com/ceptree
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
import numpy as np import matplotlib.pyplot as plt # 押した時 def Press(event): global x1,y1,DragFlag # 値がNoneなら終了 if (event.xdata is None) or (event.ydata is None): return # 丸める cx = int(round(event.xdata)) cy = int(round(event.ydata)) x1 = cx y1 = cy # フラグをたてる DragFlag = True # ドラッグした時 def Drag(event): global x1,y1,x2,y2,DragFlag # ドラッグしていなければ終了 if DragFlag == False: return # 値がNoneなら終了 if (event.xd
やりたいこと matplotlibのsubplotで描画した全ての軸に対して、グリッドやラベルなど共通の設定をしたい。 やり方 1 軸の一覧を取得する。 軸毎にループ 現在の軸を変更 # 1. 軸の一覧取得 axs = plt.gcf().get_axes() # 2. 軸毎にループ for ax in axs: # 3. 現在の軸を変更 plt.axes(ax) import matplotlib.pyplot as plt import numpy as np # データ x = np.linspace(-np.pi, np.pi, 100) y1 = np.sin(x) y2 = np.cos(x) # figure plt.figure(figsize=(8,4)) # プロット1 plt.subplot(1,2,1) plt.plot(x,y1,label='sin') # プロ
このページを最初にブックマークしてみませんか?
『@ceptreeのマイページ - Qiita』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く