Skip to content
Snippets Groups Projects
Commit 1648914b authored by Alexander Böhmländer's avatar Alexander Böhmländer
Browse files

Adjusted some parts of matrix plotting.

parent f4358d1d
No related branches found
No related tags found
No related merge requests found
......@@ -42,10 +42,6 @@ def heatmap(data, row_labels, col_labels, ax=None,
# Plot the heatmap
im = ax.imshow(data, **kwargs)
# Create colorbar
cbar = ax.figure.colorbar(im, ax=ax, **cbar_kw)
cbar.ax.set_ylabel(cbarlabel, rotation=-90, va="bottom")
# We want to show all ticks...
ax.set_xticks(np.arange(data.shape[1]))
ax.set_yticks(np.arange(data.shape[0]))
......@@ -66,6 +62,13 @@ def heatmap(data, row_labels, col_labels, ax=None,
ax.grid(False, which='both')
ax.tick_params(which="minor", bottom=False, left=False)
# correct spacing
im_ratio = data.shape[0]/data.shape[1]
# Create colorbar
cbar = ax.figure.colorbar(im, ax=ax, fraction=0.046*im_ratio, pad=0.04, **cbar_kw)
cbar.ax.set_ylabel(cbarlabel, rotation=-90, va="bottom")
return im, cbar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment