[Feature request] span axis labels
Description
I often have the issue where the axes are not shared, but I do want to share the labels. For example when I am mixing some axes and not others. I propose to add a feature where you can specify the sharing of the axis. As far as I am aware this is not available in proplot. Currently I resort to something like
def add_main(fig, nrows, ncols, span):
main = fig.add_subplot(nrows, ncols, span)
main.set_facecolor("none")
main.set_xticks([])
main.set_yticks([])
for spine in main.axes.spines.values():
spine.set_visible(False)
return main
fig, ax = plt.subplots(ncols = 2, nrows = 2, share = 0)
main_top = add_main(fig, 2, 2, (1, 2))
main_top.set_xlabel("group 1", labelpad = 25)
main_top.set_ylabel("group 1", labelpad = 25)
main_bottom = add_main(fig, 2, 2, (3, 4))
main_bottom.set_xlabel("group 2", labelpad = 25)
main_bottom.set_ylabel("group 2", labelpad = 25)
fig.show()
Resulting in
Some of it can be achieved with fig labels. If this can already be achieved, we could add it to the docs, if not we can add it.
Try this:
fig, axs = pplt.subplots(nrows=2, ncols=2, sharex=False, spanx=True)
axs[0].format(xlabel='row1')
axs[2].format(xlabel='row2')
I believe this is what you are looking for.
Ideally I would like to format subfigures. What I am getting at is how would I get a spanning label for this:
import proplot as plt
layout = [
[1, 2, 5],
[3, 4, 5]
]
fig, ax = plt.subplots(layout, sharex = True, figsize = (5,3))
ax[:4].format(xlabel = "grouped label")
ax[-1].format(xlabel = "separate label")
It would be ideal if we could index into the axis that I wish to format and making them shared in a smart way without having it apply to all subplots. The work around is to make everything manually fit where you can overlay dummy axes -- but this gets pretty complicated as the complexity of the graph grows, but in principle is possible.
helpful examples, appreciate it