@@ -697,7 +697,7 @@ def draw_path(self, gc, path, transform, rgbFace=None):
697697 sketch = gc .get_sketch_params ())
698698
699699 if gc .get_url () is not None :
700- self .writer .start ('a' , {'xlink:href' : gc .get_url ()})
700+ self .writer .start ('a' , {'xlink:href' : gc .get_url (), 'target' : '_blank' })
701701 self .writer .element ('path' , d = path_data , ** self ._get_clip_attrs (gc ),
702702 style = self ._get_style (gc , rgbFace ))
703703 if gc .get_url () is not None :
@@ -730,7 +730,7 @@ def draw_markers(
730730
731731 writer .start ('g' , ** self ._get_clip_attrs (gc ))
732732 if gc .get_url () is not None :
733- self .writer .start ('a' , {'xlink:href' : gc .get_url ()})
733+ self .writer .start ('a' , {'xlink:href' : gc .get_url (), 'target' : '_blank' })
734734 trans_and_flip = self ._make_flip_transform (trans )
735735 attrib = {'xlink:href' : f'#{ oid } ' }
736736 clip = (0 , 0 , self .width * 72 , self .height * 72 )
@@ -788,7 +788,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
788788 antialiaseds , urls , offset_position , hatchcolors = hatchcolors ):
789789 url = gc0 .get_url ()
790790 if url is not None :
791- writer .start ('a' , attrib = {'xlink:href' : url })
791+ writer .start ('a' , attrib = {'xlink:href' : url , 'target' : '_blank' })
792792 clip_attrs = self ._get_clip_attrs (gc0 )
793793 if clip_attrs :
794794 writer .start ('g' , ** clip_attrs )
@@ -966,7 +966,7 @@ def draw_image(self, gc, x, y, im, transform=None):
966966
967967 url = gc .get_url ()
968968 if url is not None :
969- self .writer .start ('a' , attrib = {'xlink:href' : url })
969+ self .writer .start ('a' , attrib = {'xlink:href' : url , 'target' : '_blank' })
970970
971971 attrib = {}
972972 oid = gc .get_gid ()
@@ -1288,7 +1288,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
12881288 self .writer .start ('g' , ** clip_attrs )
12891289
12901290 if gc .get_url () is not None :
1291- self .writer .start ('a' , {'xlink:href' : gc .get_url ()})
1291+ self .writer .start ('a' , {'xlink:href' : gc .get_url (), 'target' : '_blank' })
12921292
12931293 if mpl .rcParams ['svg.fonttype' ] == 'path' :
12941294 self ._draw_text_as_path (gc , x , y , s , prop , angle , ismath , mtext )
0 commit comments