@@ -26,8 +26,8 @@ def get_tikz_code(
26
26
tex_relative_path_to_data = None ,
27
27
strict = False ,
28
28
wrap = True ,
29
- extra_axis_parameters = set () ,
30
- extra_tikzpicture_parameters = set () ,
29
+ extra_axis_parameters = None ,
30
+ extra_tikzpicture_parameters = None ,
31
31
dpi = None ,
32
32
show_info = True
33
33
):
@@ -84,13 +84,15 @@ def get_tikz_code(
84
84
Default is ``True``.
85
85
:type wrap: bool
86
86
87
- :param extra_axis_parameters: Extra axis options to be passed (as a set) to pgfplots.
88
- Default is ``None``.
87
+ :param extra_axis_parameters: Extra axis options to be passed (as a set)
88
+ to pgfplots. Default is ``None``.
89
89
:type extra_axis_parameters: a set of strings for the pfgplots axes.
90
90
91
- :param extra_tikzpicture_parameters: Extra tikzpicture options to be passed (as a set) to pgfplots.
91
+ :param extra_tikzpicture_parameters: Extra tikzpicture options to be passed
92
+ (as a set) to pgfplots.
92
93
93
- :type extra_tikzpicture_parameters: a set of strings for the pfgplots tikzpicture.
94
+ :type extra_tikzpicture_parameters: a set of strings for the pfgplots
95
+ tikzpicture.
94
96
95
97
:param dpi: The resolution in dots per inch of the rendered image in case
96
98
of QuadMesh plots. If ``None`` it will default to the value
@@ -123,11 +125,14 @@ def get_tikz_code(
123
125
data ['font size' ] = textsize
124
126
data ['custom colors' ] = {}
125
127
data ['extra tikzpicture parameters' ] = extra_tikzpicture_parameters
126
- data ['extra axis options [base]' ] = extra_axis_parameters .copy ()
127
128
# rectangle_legends is used to keep track of which rectangles have already
128
129
# had \addlegendimage added. There should be only one \addlegenimage per
129
130
# bar chart data series.
130
131
data ['rectangle_legends' ] = set ()
132
+ if extra_axis_parameters :
133
+ data ['extra axis options [base]' ] = extra_axis_parameters .copy ()
134
+ else :
135
+ data ['extra axis options [base]' ] = set ()
131
136
132
137
if dpi is None :
133
138
savefig_dpi = mpl .rcParams ['savefig.dpi' ]
@@ -155,8 +160,9 @@ def get_tikz_code(
155
160
# write the contents
156
161
if wrap :
157
162
code += '\\ begin{tikzpicture}\n \n '
158
- code += ',\n ' .join (data ['extra tikzpicture parameters' ])
159
- code += '\n '
163
+ if extra_tikzpicture_parameters :
164
+ code += ',\n ' .join (data ['extra tikzpicture parameters' ])
165
+ code += '\n '
160
166
161
167
coldefs = _get_color_definitions (data )
162
168
if coldefs :
0 commit comments