Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a6cec0

Browse files
committed
Fixes square size calculation.
1 parent 05aecc8 commit 9a6cec0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/specialty_plots/hinton_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def hinton(matrix, max_weight=None, ax=None):
2626

2727
for (x, y), w in np.ndenumerate(matrix):
2828
color = 'white' if w > 0 else 'black'
29-
size = np.sqrt(np.abs(w))
29+
size = np.sqrt(np.abs(w) / max_weight)
3030
rect = plt.Rectangle([x - size / 2, y - size / 2], size, size,
3131
facecolor=color, edgecolor=color)
3232
ax.add_patch(rect)

0 commit comments

Comments
 (0)