0
heatmap of plotly과 비슷한 matplotlib을 사용하여 히트 맵을 플롯하려고했습니다. matshow 그림의 크기에 따른 출력을 얻을 수있는 것은 매우 작습니다.python : matplotlib의 ax.matshow 크기 변경
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
z = []
for _ in range(7):
new_row = []
for __ in range(180):
new_row.append(np.random.poisson())
z.append(list(new_row))
df1 = pd.DataFrame(np.array(z), columns=range(len(z[0])))
fig = plt.figure(figsize=(20,10))
ax = fig.add_subplot(111)
cax = ax.matshow(df1, interpolation='nearest', cmap='coolwarm')
fig.colorbar(cax)
ax.set_xticklabels([''] + list(df1.columns))
ax.set_yticklabels([''] + list(df1.index))
plt.show()
다음 내 코드입니다 : 다음은 아래 그림을 얻을 수있는 그림
입니다.
고맙습니다. 그것은 효과가 있었다. – Jeril