Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0bc3c49

Browse filesBrowse files
committed
FIX: fix bug added in last bugfix
1 parent ed91e98 commit 0bc3c49
Copy full SHA for 0bc3c49

File tree

Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed

‎lib/matplotlib/legend_handler.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend_handler.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def get_sizes(self, legend, orig_handle,
306306
xdescent, ydescent, width, height, fontsize):
307307
if self._sizes is None:
308308
handle_sizes = orig_handle.get_sizes()
309-
if not handle_sizes:
309+
if not len(handle_sizes):
310310
handle_sizes = [1]
311311
size_max = max(handle_sizes) * legend.markerscale ** 2
312312
size_min = min(handle_sizes) * legend.markerscale ** 2

‎lib/matplotlib/tests/test_legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_legend.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,17 @@ def test_nanscatter():
249249

250250
ax.legend([h], ["scatter"])
251251

252+
fig, ax = plt.subplots()
253+
for color in ['red', 'green', 'blue']:
254+
n = 750
255+
x, y = np.random.rand(2, n)
256+
scale = 200.0 * np.random.rand(n)
257+
ax.scatter(x, y, c=color, s=scale, label=color,
258+
alpha=0.3, edgecolors='none')
259+
260+
ax.legend()
261+
ax.grid(True)
262+
252263

253264
if __name__ == '__main__':
254265
import nose

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.