@@ -286,9 +286,10 @@ in ``mpl_image_compare``. Supported formats are ``'eps'``, ``'pdf'``, ``'png'``,
286
286
Note that Ghostscript is required to be installed for comparing PDF and EPS figures, while
287
287
Inkscape is required for SVG comparison.
288
288
289
- By default, Matplotlib does not produce deterministic output that will
290
- have a consistent hash every time it is run, or over different Matplotlib versions.
291
- In order to enforce that the output is deterministic, you will need to do the following:
289
+ By default, Matplotlib does not produce deterministic output that will have a
290
+ consistent hash every time it is run, or over different Matplotlib versions. In
291
+ order to enforce that the output is deterministic, you will need to set metadata
292
+ as described in the following subsections.
292
293
293
294
PNG
294
295
^^^
@@ -311,6 +312,8 @@ For PDF files, the output can be made deterministic by setting:
311
312
" Producer" : None ,
312
313
" CreationDate" : None }})
313
314
315
+ Note that deterministic PDF output can only be achieved with Matplotlib 2.1 and above
316
+
314
317
EPS
315
318
^^^
316
319
@@ -330,6 +333,8 @@ a constant value (this is a unit timestamp):
330
333
331
334
You could do this inside the test.
332
335
336
+ Note that deterministic PDF output can only be achieved with Matplotlib 2.1 and above
337
+
333
338
SVG
334
339
^^^
335
340
@@ -345,6 +350,8 @@ and in addition, you should make sure the following rcParam is set to a constant
345
350
346
351
plt.rcParams[' svg.hashsalt' ] = ' test'
347
352
353
+ Note that SVG files can only be used in pytest- mpl with Matplotlib 3.3 and above.
354
+
348
355
Test failure example
349
356
--------------------
350
357
0 commit comments