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

Skip to content

Commit 512e403

Browse files
afvincentanntzer
authored andcommitted
leverage modern numpy functions
1 parent ae201fc commit 512e403

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/legend_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def create_artists(self, legend, orig_handle,
295295
xdata = np.linspace(xdata[0], xdata[-1], 3)
296296
markevery = [1]
297297

298-
ydata = ((height - ydescent) / 2.) * np.ones(xdata.shape, float)
298+
ydata = np.full_like(xdata, (height - ydescent) / 2)
299299
legline = Line2D(xdata, ydata, markevery=markevery)
300300

301301
self.update_prop(legline, orig_handle, legend)

0 commit comments

Comments
 (0)