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