|
1 | | -Reproducible PS and PDF output |
2 | | ------------------------------- |
| 1 | +Reproducible PS, PDF and SVG output |
| 2 | +----------------------------------- |
3 | 3 |
|
4 | 4 | The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set |
5 | 5 | the timestamp value in the PS and PDF outputs. See |
6 | 6 | https://reproducible-builds.org/specs/source-date-epoch/ |
7 | 7 |
|
| 8 | +Alternatively, calling ``savefig`` with ``metadata={creationDate=None}`` |
| 9 | +will omit the timestamp altogether. |
| 10 | + |
8 | 11 | The reproducibility of the output from the PS and PDF backends has so |
9 | 12 | far been tested using various plot elements but only default values of |
10 | 13 | options such as ``{ps,pdf}.fonttype`` that can affect the output at a |
11 | 14 | low level, and not with the mathtext or usetex features. When |
12 | 15 | matplotlib calls external tools (such as PS distillers or LaTeX) their |
13 | 16 | versions need to be kept constant for reproducibility, and they may |
14 | 17 | add sources of nondeterminism outside the control of matplotlib. |
| 18 | + |
| 19 | +For SVG output, the ``svg.hashsalt`` rc parameter has been added in an |
| 20 | +earlier release. In can be used to change some random id values in the |
| 21 | +output to be deterministic, at the cost that including multiple such |
| 22 | +svg files in one document can lead to collisions. |
| 23 | + |
| 24 | +These features are now enabled in the tests for the pdf and svg |
| 25 | +backends, so most test output files (but not all of them) are now |
| 26 | +deterministic. |
0 commit comments