Skip to content

Commit fd5b479

Browse files
authored
Merge pull request nschloe#272 from Aikhjarto/master
fix nschloe#271 by making "encoding" visible and mention it in docstring
2 parents 6df24d0 + cc298cf commit fd5b479

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

matplotlib2tikz/save.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,13 @@ def get_tikz_code(
207207
return code
208208

209209

210-
def save(*args, **kwargs):
210+
def save(*args, encoding=None, **kwargs):
211211
"""Same as `get_tikz_code()`, but actually saves the code to a file.
212+
213+
:param encoding: Sets the text encoding of the output file, e.g. 'utf-8'.
214+
For supported values: see ``codecs`` module.
215+
:returns: None
212216
"""
213-
encoding = kwargs.pop("encoding", None)
214217
code = get_tikz_code(*args, **kwargs)
215218
file_handle = codecs.open(args[0], "w", encoding)
216219
try:

0 commit comments

Comments
 (0)