Skip to content

Commit 3ba108c

Browse files
committed
correction of 'seperated parameter extra in extra_axis_opt and extra_picture_opt'
1 parent 48e1fdb commit 3ba108c

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

matplotlib2tikz/save.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def get_tikz_code(
2626
tex_relative_path_to_data=None,
2727
strict=False,
2828
wrap=True,
29-
extra_axis_opt=None,
30-
extra_picture_opt=None,
29+
extra_axis_parameters=set(),
30+
extra_tikzpicture_parameters=set(),
3131
dpi=None,
3232
show_info=True
3333
):
@@ -84,13 +84,13 @@ def get_tikz_code(
8484
Default is ``True``.
8585
:type wrap: bool
8686
87-
:param extra_axis_opt: Extra axis options to be passed (as a set) to pgfplots.
87+
:param extra_axis_parameters: Extra axis options to be passed (as a set) to pgfplots.
8888
Default is ``None``.
89-
:type extra_axis_opt: a set of strings for the pfgplots axes.
89+
:type extra_axis_parameters: a set of strings for the pfgplots axes.
9090
91-
:param extra_picture_opt: Extra tikzpicture options to be passed (as a set) to pgfplots.
92-
Default is ``None``.
93-
:type extra_picture_opt: a set of strings for the pfgplots tikzpicture.
91+
:param extra_tikzpicture_parameters: Extra tikzpicture options to be passed (as a set) to pgfplots.
92+
93+
:type extra_tikzpicture_parameters: a set of strings for the pfgplots tikzpicture.
9494
9595
:param dpi: The resolution in dots per inch of the rendered image in case
9696
of QuadMesh plots. If ``None`` it will default to the value
@@ -122,19 +122,15 @@ def get_tikz_code(
122122
data['pgfplots libs'] = set()
123123
data['font size'] = textsize
124124
data['custom colors'] = {}
125+
data['extra tikzpicture parameters'] = extra_tikzpicture_parameters
125126
# rectangle_legends is used to keep track of which rectangles have already
126127
# had \addlegendimage added. There should be only one \addlegenimage per
127128
# bar chart data series.
128129
data['rectangle_legends'] = set()
129-
if extra_axis_opt:
130-
data['extra axis options [base]'] = extra_axis_opt.copy()
131-
else:
132-
data['extra axis options [base]'] = set()
133-
134-
if extra_picture_opt:
135-
data['extra picture options'] = extra_picture_opt.copy()
136-
else:
137-
data['extra picture options'] = set()
130+
#if extra_axis_parameters:
131+
data['extra axis options [base]'] = extra_axis_parameters.copy()
132+
#else:
133+
# data['extra axis options [base]'] = set()
138134

139135
if dpi is None:
140136
savefig_dpi = mpl.rcParams['savefig.dpi']
@@ -162,10 +158,8 @@ def get_tikz_code(
162158
# write the contents
163159
if wrap:
164160
code += '\\begin{tikzpicture}\n\n'
165-
if extra_picture_opt:
166-
for options in data['extra picture options']:
167-
code += options + ',\n'
168-
161+
code += ',\n'.join(data['extra tikzpicture parameters'])
162+
code += '\n'
169163

170164
coldefs = _get_color_definitions(data)
171165
if coldefs:

0 commit comments

Comments
 (0)