|
10 | 10 | import numpy as np |
11 | 11 |
|
12 | 12 | from hashlib import md5 |
| 13 | +import uuid |
13 | 14 |
|
14 | 15 | from matplotlib import verbose, __version__, rcParams |
15 | 16 | from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ |
@@ -255,7 +256,7 @@ def __init__(self, width, height, svgwriter, basename=None, image_dpi=72): |
255 | 256 | self.width = width |
256 | 257 | self.height = height |
257 | 258 | self.writer = XMLWriter(svgwriter) |
258 | | - self.image_dpi = image_dpi # the actual dpi we want to rasterize stuff with |
| 259 | + self.image_dpi = image_dpi # the actual dpi we want to rasterize stuff with |
259 | 260 |
|
260 | 261 | self._groupd = {} |
261 | 262 | if not rcParams['svg.image_inline']: |
@@ -309,9 +310,14 @@ def _write_default_style(self): |
309 | 310 |
|
310 | 311 | def _make_id(self, type, content): |
311 | 312 | content = str(content) |
| 313 | + salt = str(uuid.uuid4()) |
312 | 314 | if six.PY3: |
313 | 315 | content = content.encode('utf8') |
314 | | - return '%s%s' % (type, md5(content).hexdigest()[:10]) |
| 316 | + salt = salt.encode('utf8') |
| 317 | + m = md5() |
| 318 | + m.update(salt) |
| 319 | + m.update(content) |
| 320 | + return '%s%s' % (type, m.hexdigest()[:10]) |
315 | 321 |
|
316 | 322 | def _make_flip_transform(self, transform): |
317 | 323 | return (transform + |
@@ -532,7 +538,7 @@ def close_group(self, s): |
532 | 538 |
|
533 | 539 | def option_image_nocomposite(self): |
534 | 540 | """ |
535 | | - return whether to generate a composite image from multiple images on |
| 541 | + return whether to generate a composite image from multiple images on |
536 | 542 | a set of axes |
537 | 543 | """ |
538 | 544 | if rcParams['svg.image_noscale']: |
|
0 commit comments