1

matplotlib を使用して周波数ピクセル マップを作成するにはどうすればよいかを尋ねたかっただけです。この用語は、次のようなものを意味します。

http://img513.imageshack.us/img513/8677/g8df.png

正方形の色は、対応する時間と間隔の頻度を表します。

一連の 50 個のパッチをプロットし、データに従ってカラー スケールを使用して色付けすることを考えていました。または、これを行うより良い方法はありますか?

ありがとう

4

1 に答える 1

1

基本的にはplt.hist2d.

import numpy as np
import matplotlib.pyplot as plt

data = np.array([[8,  15,  1, 65, 79],
                 [45, 22, 60, 43, 16],
                 [3,  75, 90, 11, 14],
                 [89, 32, 27, 59, 99],
                 [62,  5, 54, 92, 81]])
nrows, ncols = data.shape
# Generate 1-based row indicies, similar to your table
row = np.vstack(ncols * [np.arange(nrows) + 1]).T

x, y = row.flatten(), data.flatten()

xbins = np.arange(nrows+1) + 0.5
plt.hist2d(x, y, bins=(xbins, 10), cmap=plt.cm.Reds)
plt.show()

ここに画像の説明を入力

于 2013-10-25T13:33:51.213 に答える