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

Skip to content

Commit be305a3

Browse files
committed
Merge pull request matplotlib#4186 from mdboom/close-clipped-paths
Close clipped paths
2 parents 6387fca + 3b63c19 commit be305a3

File tree

9 files changed

+710
-2
lines changed

9 files changed

+710
-2
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ def print_figure_impl():
11891189
print("%s translate"%_nums_to_str(xo, yo), file=fh)
11901190
if rotation: print("%d rotate"%rotation, file=fh)
11911191
print("%s clipbox"%_nums_to_str(width*72, height*72, 0, 0), file=fh)
1192+
# Disable any sort of miter limit
1193+
print("%s setmiterlimit" % 100000, file=fh)
11921194

11931195
# write the figure
11941196
content = self._pswriter.getvalue()
@@ -1338,6 +1340,8 @@ def write(self, *kl, **kwargs):
13381340
#print >>fh, "gsave"
13391341
print("%s translate"%_nums_to_str(xo, yo), file=fh)
13401342
print("%s clipbox"%_nums_to_str(width*72, height*72, 0, 0), file=fh)
1343+
# Disable any sort of miter limit
1344+
print("%d setmiterlimit" % 100000, file=fh)
13411345

13421346
# write the figure
13431347
print(self._pswriter.getvalue(), file=fh)

lib/matplotlib/backends/backend_svg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ def _write_default_style(self):
297297
writer = self.writer
298298
default_style = generate_css({
299299
'stroke-linejoin': 'round',
300-
'stroke-linecap': 'butt'})
300+
'stroke-linecap': 'butt',
301+
# Disable the miter limit. 100000 seems to be close to
302+
# the maximum that renderers support before breaking.
303+
'stroke-miterlimit': '100000'})
301304
writer.start('defs')
302305
writer.start('style', type='text/css')
303306
writer.data('*{%s}\n' % default_style)
Binary file not shown.

0 commit comments

Comments
 (0)