Skip to content

Commit

Permalink
Call align_ylabels on subset plots
Browse files Browse the repository at this point in the history
  • Loading branch information
jnothman committed Dec 31, 2023
1 parent cbd43a4 commit 6915e39
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions upsetplot/plotting.py
Expand Up @@ -104,34 +104,36 @@ def __call__(self, *args, **kwargs):
)

_NAME_TRANSPOSE = {
"width": "height",
"height": "width",
"hspace": "wspace",
"wspace": "hspace",
"hlines": "vlines",
"vlines": "hlines",
"align_xlabels": "align_ylabels",
"align_ylabels": "align_xlabels",
"bar": "barh",
"barh": "bar",
"xaxis": "yaxis",
"yaxis": "xaxis",
"left": "bottom",
"right": "top",
"top": "right",
"bottom": "left",
"sharex": "sharey",
"sharey": "sharex",
"get_figwidth": "get_figheight",
"get_figheight": "get_figwidth",
"set_figwidth": "set_figheight",
"set_figheight": "set_figwidth",
"set_xlabel": "set_ylabel",
"set_ylabel": "set_xlabel",
"set_xlim": "set_ylim",
"set_ylim": "set_xlim",
"get_figwidth": "get_figheight",
"get_xlim": "get_ylim",
"get_ylim": "get_xlim",
"height": "width",
"hlines": "vlines",
"hspace": "wspace",
"left": "bottom",
"right": "top",
"set_autoscalex_on": "set_autoscaley_on",
"set_autoscaley_on": "set_autoscalex_on",
"set_figheight": "set_figwidth",
"set_figwidth": "set_figheight",
"set_xlabel": "set_ylabel",
"set_xlim": "set_ylim",
"set_ylabel": "set_xlabel",
"set_ylim": "set_xlim",
"sharex": "sharey",
"sharey": "sharex",
"top": "right",
"vlines": "hlines",
"width": "height",
"wspace": "hspace",
"xaxis": "yaxis",
"yaxis": "xaxis",
}


Expand Down Expand Up @@ -1113,6 +1115,10 @@ def plot(self, fig=None):
else:
raise ValueError("Unknown subset plot type: %r" % plot["type"])
out[plot["id"]] = ax

self._reorient(fig).align_ylabels(
[out[plot["id"]] for plot in self._subset_plots]
)
return out

PLOT_TYPES = {
Expand Down

0 comments on commit 6915e39

Please sign in to comment.