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

Skip to content

Commit 25fbe8f

Browse files
mdboomtacaswell
authored andcommitted
FIX: Only render single patch for scatter
1 parent b9ba7ea commit 25fbe8f

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
@@ -316,7 +316,7 @@ def get_sizes(self, legend, orig_handle,
316316
numpoints = self.get_numpoints(legend)
317317
if numpoints < 4:
318318
sizes = [.5 * (size_max + size_min), size_max,
319-
size_min]
319+
size_min][:numpoints]
320320
else:
321321
rng = (size_max - size_min)
322322
sizes = rng * np.linspace(0, 1, numpoints) + size_min

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)