python - Using pyplot pcolor for a heatmap, need to add subtotals -
i have pandas data frame values:
[[7.86, 0.25, 2.87, 1.09, 27.09] [ 0.54, 0.0, 0.44, 0.49, 2.03], [ 5.34, 0.79, 2.32, 0.54, 3.76], [ 2.22, 0.49, 0.79, 0.2, 0.3 ], [31.98, 0.89, 2.62, 0.15, 4.94]]
i'm calling matplotlib with:
plt.figure(figsize=(7, 6)) plt.title(title) plt.xlabel(xlabel) plt.ylabel(ylabel) plt.yticks(np.arange(0.5, len(d.index), 1), d.index) plt.xticks(np.arange(0.5, len(d.columns), 1), d.columns) c = plt.pcolor(d, cmap="pubu") show_values(c) plt.tight_layout() plt.autoscale() plt.show()
and getting result:
what need do, , can't find documentation, show subtotals each row , column of matrix on axes. don't know if there's specific option or if need add 10/11 annotations it.
Comments
Post a Comment