Skip to content

Commit 2a5059d

Browse files
authored
Merge pull request #374 from eric-wieser/groupstyle_options
Add support for extra groupstyle options
2 parents fbd6f57 + 24f3c0c commit 2a5059d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tikzplotlib/_axes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,11 @@ def _subplot(self, obj, data):
417417
# subplotspec geometry positioning is 0-based
418418
self.subplot_index = geom[2] + 1
419419
if "is_in_groupplot_env" not in data or not data["is_in_groupplot_env"]:
420+
group_style = ["group size={} by {}".format(geom[1], geom[0])]
421+
group_style.extend(data["extra groupstyle options [base]"])
422+
options = ["group style={{{}}}".format(", ".join(group_style))]
420423
self.content.append(
421-
"\\begin{{groupplot}}[group style="
422-
"{{group size={} by {}}}]".format(geom[1], geom[0])
424+
"\\begin{{groupplot}}[{}]".format(", ".join(options))
423425
)
424426
data["is_in_groupplot_env"] = True
425427
data["pgfplots libs"].add("groupplots")

tikzplotlib/_save.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def get_tikz_code(
2727
wrap=True,
2828
add_axis_environment=True,
2929
extra_axis_parameters=None,
30+
extra_groupstyle_parameters={},
3031
extra_tikzpicture_parameters=None,
3132
dpi=None,
3233
show_info=False,
@@ -174,6 +175,7 @@ def get_tikz_code(
174175
data["extra axis options [base]"] = set(extra_axis_parameters).copy()
175176
else:
176177
data["extra axis options [base]"] = set()
178+
data["extra groupstyle options [base]"] = extra_groupstyle_parameters
177179

178180
if dpi:
179181
data["dpi"] = dpi

0 commit comments

Comments
 (0)