物理の駅 Physics station by 現役研究者
id:onsanai
Python+matplotlibの二次元ヒストグラムhist2dでエントリー数が0のビンの色を白くする方法
カラーバーを線形スケールで描画する場合、countsが0のbinを白くする方法は3通りあります。 np.histogram2d でhistデータを作成し plt.pcolormesh で描画する方法 下限値を白にしたカラーマップを使って plt.hist2d で描画する方法 端だけに白にしたカラーマップを使って plt.hist2d で描画する方法 (おすすめ) データ作成…