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

Skip to content

Commit 06ec9a1

Browse files
committed
crude fix for figure legends
1 parent c7bcf69 commit 06ec9a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/lines.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,13 @@ def draw(self, renderer):
801801
# subsample the markers if markevery is not None
802802
markevery = self.get_markevery()
803803
if markevery is not None:
804+
try:
805+
transform = self.axes.transAxes
806+
except AttributeError:
807+
# Typically in the case of a **figure** legend.
808+
transform = self.get_transform()
804809
subsampled = _mark_every_path(markevery, tpath,
805-
affine, self.axes.transAxes)
810+
affine, transform)
806811
else:
807812
subsampled = tpath
808813

0 commit comments

Comments
 (0)