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

Skip to content

Commit 3de62de

Browse files
committed
Fix some crashes in the SVG backend found by @efiring. Also, add a Gouraud shading test to test framework so this doesn't fall through the cracks again
1 parent 1283b46 commit 3de62de

5 files changed

Lines changed: 24242 additions & 1627 deletions

File tree

lib/matplotlib/backends/backend_svg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,12 +641,12 @@ def draw_gouraud_triangle(self, gc, points, colors, trans):
641641
x1=str(x1), y1=str(y1), x2=str(xb), y2=str(yb))
642642
writer.element(
643643
'stop',
644-
offset=0,
644+
offset='0',
645645
style=generate_css({'stop-color': rgb2hex(c),
646646
'stop-opacity': str(c[-1])}))
647647
writer.element(
648648
'stop',
649-
offset=1,
649+
offset='1',
650650
style=generate_css({'stop-color': rgb2hex(c),
651651
'stop-opacity': "0"}))
652652
writer.end('linearGradient')
@@ -788,7 +788,7 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
788788
if color != '#000000':
789789
style['fill'] = color
790790
if gc.get_alpha() != 1.0:
791-
style['opacity'] = gc.get_alpha()
791+
style['opacity'] = str(gc.get_alpha())
792792

793793
if not ismath:
794794
font = text2path._get_font(prop)
@@ -891,7 +891,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath):
891891
if color != '#000000':
892892
style['fill'] = color
893893
if gc.get_alpha() != 1.0:
894-
style['opacity'] = gc.get_alpha()
894+
style['opacity'] = str(gc.get_alpha())
895895

896896
if not ismath:
897897
font = self._get_font(prop)
11 KB
Binary file not shown.
64.8 KB
Loading

0 commit comments

Comments
 (0)