Skip to content

Commit d58a2a5

Browse files
committed
Merge pull request matplotlib#4586 from efiring/mec_alpha
FIX: respect alpha in RGBA markeredgecolor closes matplotlib#4580
2 parents 0bbd127 + cb1c28a commit d58a2a5

File tree

5 files changed

+633
-4
lines changed

5 files changed

+633
-4
lines changed

lib/matplotlib/lines.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,12 @@ def draw(self, renderer):
753753
else:
754754
gc.set_foreground(edgecolor)
755755
gc.set_linewidth(self._markeredgewidth)
756+
mec = self._markeredgecolor
757+
if (is_string_like(mec) and mec == 'auto' and
758+
rgbaFace is not None):
759+
gc.set_alpha(rgbaFace[3])
760+
else:
761+
gc.set_alpha(self.get_alpha())
756762

757763
marker = self._marker
758764
tpath, affine = transf_path.get_transformed_points_and_affine()
@@ -779,19 +785,20 @@ def draw(self, renderer):
779785
marker_trans = marker_trans.scale(w)
780786
else:
781787
gc.set_linewidth(0)
782-
if rgbaFace is not None:
783-
gc.set_alpha(rgbaFace[3])
784788

785789
renderer.draw_markers(gc, marker_path, marker_trans,
786790
subsampled, affine.frozen(),
787791
rgbaFace)
788792

789793
alt_marker_path = marker.get_alt_path()
790794
if alt_marker_path:
791-
if rgbaFaceAlt is not None:
792-
gc.set_alpha(rgbaFaceAlt[3])
793795
alt_marker_trans = marker.get_alt_transform()
794796
alt_marker_trans = alt_marker_trans.scale(w)
797+
if (is_string_like(mec) and mec == 'auto' and
798+
rgbaFaceAlt is not None):
799+
gc.set_alpha(rgbaFaceAlt[3])
800+
else:
801+
gc.set_alpha(self.get_alpha())
795802

796803
renderer.draw_markers(
797804
gc, alt_marker_path, alt_marker_trans, subsampled,
3.13 KB
Binary file not shown.
55 KB
Loading

0 commit comments

Comments
 (0)