Skip to content

Don't allow 1D lists as subplot_moasic layout. #17938

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

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

timhoffm
Copy link
Member

PR Summary

plt.subplot_mosaic(['foo', 'bar']) created a layout
image

which is probably surprising, the characters of the inner strings being interpreted as separate specifiers.

This PR chooses the strict solution and prohibits 1D lists of strings and raise a ValueError in this case.

Alterantive solution

An alternative solution would be to allow it and create
image

E.g. we allow the string version to be 1D: plt.subplot_mosaic('fb') generates plots f and b side-by-side.

OTOH we can start with failing and add that feature later if wanted.

ping @tacaswell

@timhoffm timhoffm added this to the v3.3.0 milestone Jul 15, 2020
@QuLogic QuLogic requested a review from tacaswell July 15, 2020 21:29
@tacaswell
Copy link
Member

Sorry I missed this initially.

@jklymak jklymak merged commit dc9b353 into matplotlib:master Jul 15, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 15, 2020
QuLogic added a commit that referenced this pull request Jul 16, 2020
…938-on-v3.3.x

Backport PR #17938 on branch v3.3.x (Don't allow 1D lists as subplot_moasic layout.)
@timhoffm timhoffm deleted the subplot_mosaic_1D_list branch July 16, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants