Skip to content

Commit db359f8

Browse files
committed
treat extra_tikzpicture_parameters properly
Fixes #266.
1 parent 133154a commit db359f8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tikzplotlib/save.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ def get_tikz_code(
105105
106106
:param extra_tikzpicture_parameters: Extra tikzpicture options to be passed
107107
(as a set) to pgfplots.
108-
109-
:type extra_tikzpicture_parameters: a set of strings for the pfgplots
110-
tikzpicture.
108+
:type extra_tikzpicture_parameters: a set of strings for the pfgplots tikzpicture.
111109
112110
:param dpi: The resolution in dots per inch of the rendered image in case
113111
of QuadMesh plots. If ``None`` it will default to the value
@@ -166,7 +164,6 @@ def get_tikz_code(
166164
data["font size"] = textsize
167165
data["custom colors"] = {}
168166
data["legend colors"] = []
169-
data["extra tikzpicture parameters"] = extra_tikzpicture_parameters
170167
data["add axis environment"] = add_axis_environment
171168
data["show_info"] = show_info
172169
# rectangle_legends is used to keep track of which rectangles have already
@@ -210,10 +207,10 @@ def get_tikz_code(
210207

211208
# write the contents
212209
if wrap and add_axis_environment:
213-
code += "\\begin{tikzpicture}\n\n"
210+
code += "\\begin{tikzpicture}"
214211
if extra_tikzpicture_parameters:
215-
code += ",\n".join(data["extra tikzpicture parameters"])
216-
code += "\n"
212+
code += "[\n" + ",\n".join(extra_tikzpicture_parameters) + "\n]"
213+
code += "\n\n"
217214

218215
coldefs = _get_color_definitions(data)
219216
if coldefs:

0 commit comments

Comments
 (0)