Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suptitle for show_rdms #351

Open
caiw opened this issue Oct 9, 2023 · 0 comments
Open

Suptitle for show_rdms #351

caiw opened this issue Oct 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@caiw
Copy link
Member

caiw commented Oct 9, 2023

Is your feature request related to a problem? Please describe.
When I'm writing a notebook, I like to add titles to all my plots. When I'm doing a quick show_rdms, I'd like to add a title to the figure, such as "Categorical model RDMs".

At the moment, if I run

fig, _axs, _items = show_rdm(model_rdms, rdm_descriptor="Name", pattern_descriptor="Conditions")
fig.suptitle("Categorical model RDMs")

I get:
categorical-model-rdms

This is probably because of the way tight_layout works?

Describe the solution you'd like
The figure returned by show_rdms to be amenable to adding a fig.suptitle(), so that the above code snippet instead produces something like:
categorical-model-rdms

This may be achievable by using constrained_layout instead of tight_layout, but I can't actually see where it's being set.

It might also be achievable by using pyplot.subplots_adjust(top=0.75) or similar (this fixes it for me in the above example), but the top arg should be determinable from the figure rather than guesswork.

Describe alternatives you've considered

  • Just manually adjusting the output of show_rdms every time: the current situation.
  • A dedicated title argument for show_rdms. However since it already returns the figure handle, and the figure has .suptitle(), that seems like the better way to do it, to avoid crowding the API.
@caiw caiw added the enhancement New feature or request label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant