10000 Merge pull request #7214 from tacaswell/multiple-legend-handles · matplotlib/matplotlib@568b523 · GitHub
[go: up one dir, main page]

Skip to content

Commit 568b523

Browse files
NelleVtacaswell
authored andcommitted
Merge pull request #7214 from tacaswell/multiple-legend-handles
FIX: Only render single patch for scatter
1 parent e82032c commit 568b523

File tree

4 files changed

+64
-94
lines changed

4 files changed

+64
-94
lines changed

lib/matplotlib/legend_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def get_sizes(self, legend, orig_handle,
314314
numpoints = self.get_numpoints(legend)
315315
if numpoints < 4:
316316
sizes = [.5 * (size_max + size_min), size_max,
317-
size_min]
317+
size_min][:numpoints]
318318
else:
319319
rng = (size_max - size_min)
320320
sizes = rng * np.linspace(0, 1, numpoints) + size_min
Loading

lib/matplotlib/tests/baseline_images/test_legend/scatter_rc1.svg

Lines changed: 61 additions & 91 deletions
Loading

lib/matplotlib/tests/test_backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def test_uses_per_path():
2525
def check(master_transform, paths, all_transforms,
2626
offsets, facecolors, edgecolors):
2727
rb = RendererBase()
28-
raw_paths = list(rb._iter_collection_raw_paths(master_transform,
29-
paths, all_transforms))
28+
raw_paths = list(rb._iter_collection_raw_paths(
29+
master_transform, paths, all_transforms))
3030
gc = rb.new_gc()
3131
ids = [path_id for xo, yo, path_id, gc0, rgbFace in
3232
rb._iter_collection(gc, master_transform, all_transforms,

0 commit comments

Comments
 (0)
0