0
私は1996年から2015年までの竜巻データの分析に取り組んでいます。私は竜巻の数を州ごとの総資産損失と比較しています。MATPLOTLIB - プロットの縮尺を増やす
私は基本的なプロットを持っていますが、小さい数字があまりにも密接に束ねている一緒に
私が知りたいのですが、もう少しこれらを分散するように私はこれを拡張することができます方法です?
プロットのための私のコードは、私はX-ティックとy-ティックを設定して周りにプレイしましたが、それらは私がない限り(ちょうどより多くのダニを追加し、スケールを調整していないようです
count = tonadoes_1996_damage['count']
loss = tonadoes_1996_damage['total_loss']
max_tornado_count = tonadoes_1996_damage['count'].max()
max_tornado_cnt_label = tonadoes_1996_damage[tonadoes_1996_damage['count'] == max_tornado_count].index.tolist()[0]
max_tornado_cnt_x = tonadoes_1996_damage[tonadoes_1996_damage['count'] == max_tornado_count]['count']
max_tornado_cnt_y = tonadoes_1996_damage[tonadoes_1996_damage['count'] == max_tornado_count]['total_loss']
max_tornado_loss = tonadoes_1996_damage['total_loss'].max()
max_tornado_loss_label = tonadoes_1996_damage[tonadoes_1996_damage['total_loss'] == max_tornado_loss].index.tolist()[0]
max_tornado_loss_x = tonadoes_1996_damage[tonadoes_1996_damage['total_loss'] == max_tornado_loss]['count']
max_tornado_loss_y = tonadoes_1996_damage[tonadoes_1996_damage['total_loss'] == max_tornado_loss]['total_loss']
colors = np.random.rand(51)
area = count
plt.scatter(count, loss,s=area,c=colors,alpha=.5)
xlab = "Number of Tornadoes [in thousands]"
ylab = "Total Loss [in million USD]"
title = "Total Property Loss Since 1996"
plt.xlabel(xlab)
plt.xlim(0, 3500)
plt.ylabel(ylab)
plt.ylim(0, 6000)
plt.title(title)
plt.grid(True)
plt.text(max_tornado_cnt_x, max_tornado_cnt_y, max_tornado_cnt_label)
plt.text(max_tornado_loss_x, max_tornado_loss_y, max_tornado_loss_label)
plt.show()
です何か間違ったことをやっている
必要に応じてここから選択できます。 http://matplotlib.org/gallery.html。私は毎年の別のプロットの傾向を示すことを示唆し、それらを表示し、1996年から2015年までのすべてを1つのプロットで単純なグリッドとして表示し、結合した結果を表示することをお勧めします。 [this one](http://matplotlib.org/examples/axes_grid/simple_axesgrid.html) –