Skip to content

Commit 6b46b8c

Browse files
committed
Gouraud Triangle SVG
pcolormesh.svg update
1 parent d989da1 commit 6b46b8c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/backends/backend_svg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,16 @@ def draw_gouraud_triangle(self, gc, points, colors, trans):
696696
values='1 0 0 0 0 \n0 1 0 0 0 \n0 0 1 0 0' +
697697
' \n1 1 1 1 0 \n0 0 0 0 1 ')
698698
writer.end('filter')
699+
# feColorMatrix filter to correct opacity
700+
writer.start(
701+
'filter',
702+
id='colorMat')
703+
writer.element(
704+
'feColorMatrix',
705+
attrib={'type': 'matrix'},
706+
values='1 0 0 0 0 \n0 1 0 0 0 \n0 0 1 0 0' +
707+
' \n1 1 1 1 0 \n0 0 0 0 1 ')
708+
writer.end('filter')
699709

700710
avg_color = np.sum(colors[:, :], axis=0) / 3.0
701711
# Just skip fully-transparent triangles

0 commit comments

Comments
 (0)