File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Added ``svg.hashsalt `` key to rcParams
2+ ```````````````````````````````````````
3+ If ``svg.hashsalt `` is ``None `` (which it is by default), the svg backend uses ``uuid4 `` to generate the hash salt.
4+ If it is not ``None ``, it must be a string that is used as the hash salt instead of ``uuid4 ``.
5+ This allows for deterministic SVG output.
Original file line number Diff line number Diff line change @@ -308,7 +308,10 @@ def _write_default_style(self):
308308
309309 def _make_id (self , type , content ):
310310 content = str (content )
311- salt = str (uuid .uuid4 ())
311+ if rcParams ['svg.hashsalt' ] is None :
312+ salt = str (uuid .uuid4 ())
313+ else :
314+ salt = rcParams ['svg.hashsalt' ]
312315 if six .PY3 :
313316 content = content .encode ('utf8' )
314317 salt = salt .encode ('utf8' )
Original file line number Diff line number Diff line change @@ -1165,6 +1165,7 @@ def validate_hist_bins(s):
11651165 # True to save all characters as paths in the SVG
11661166 'svg.embed_char_paths' : [True , deprecate_svg_embed_char_paths ],
11671167 'svg.fonttype' : ['path' , validate_svg_fonttype ],
1168+ 'svg.hashsalt' : [None , validate_any ],
11681169
11691170 # set this when you want to generate hardcopy docstring
11701171 'docstring.hardcopy' : [False , validate_bool ],
You can’t perform that action at this time.
0 commit comments