You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SVG output: incremental ID scheme for non-rectangular clip paths. (#27833)
This change enables more diagrams to emit deterministic (repeatable) SVG
format output -- provided that the prerequisite ``hashsalt`` rcParams
option has been configured, and also that the clip paths themselves are
added to the diagram(s) in deterministic order.
Previously, the Python built-in ``id(...)`` function was used to provide
a convenient but runtime-varying (and therefore non-deterministic)
mechanism to uniquely identify each clip path instance; instead here we
introduce an in-memory dictionary to store and lookup sequential integer
IDs that are assigned to each clip path.
Some SVG-format plots `produced different output on each render <https://github.com/matplotlib/matplotlib/issues/27831>`__, even with a static ``svg.hashsalt`` value configured.
5
+
6
+
The problem was a non-deterministic ID-generation scheme for clip paths; the fix introduces a repeatable, monotonically increasing integer ID scheme as a replacement.
7
+
8
+
Provided that plots add clip paths themselves in deterministic order, this enables repeatable (a.k.a. reproducible, deterministic) SVG output.
0 commit comments