Description
Bug summary
Hello - I'm trying to make the astroplan
documentation build reproducibly in Debian, and have found a snag: despite configuring the svg.hashsalt
to successfully make path
identifiers in some SVG plots generated by matplotlib
deterministic, there is a remaining problem that clipPath
identifiers are nondeterministic.
The cause appears to be the use of Python object ID (via id(...)
calls here) when generating clippath
IDs.
Code for reproduction
import matplotlib as mpl
import matplotlib.pyplot as plt
import sys
mpl.rcParams["svg.hashsalt"] = "fixed-salt"
fig = plt.gcf()
fig.add_subplot(projection="polar")
plt.savefig(sys.stdout.buffer, format="svg")
Actual outcome
Differences appear in the clipPath
identifiers and their references from elsewhere in the SVG output.
Expected outcome
When an svg.hashsalt
value is configured, the SVG output should be deterministic.
Additional information
This could arguably be an enhancement request rather than a bug.
Configuring a static PYTHONHASHSEED
value does not help to produce deterministic results.
Operating system
Debian GNU/Linux (trixie)
Matplotlib Version
3.6.3
Matplotlib Backend
TkAgg
Python version
Python 3.11.8
Jupyter version
N/A
Installation
Linux package manager