legendHandles is deprecated in matplotlib==3.7
Another deprecation warning:
MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
lgnd.legendHandles[0]._sizes = [marker_size*5]
Edited by Kamila Zdybal