Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use format() for shared subplot slice titles#652

Merged
cvanelteren merged 8 commits into
mainUltraplot/UltraPlot:mainfrom
feature/shared-subplot-titleUltraplot/UltraPlot:feature/shared-subplot-titleCopy head branch name to clipboard
Apr 7, 2026
Merged

Use format() for shared subplot slice titles#652
cvanelteren merged 8 commits into
mainUltraplot/UltraPlot:mainfrom
feature/shared-subplot-titleUltraplot/UltraPlot:feature/shared-subplot-titleCopy head branch name to clipboard

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

We should make more use of the slicing feature to format a subset and assume the user aims to share the titles. This is a move in making the format function more intuitive.

Closes #650 #651

This comment was marked as outdated.

This comment was marked as off-topic.

@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Need to fix a small bbox alignment but other than that it works.

@codecov

codecov Bot commented Mar 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.20000% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/figure.py 70.29% 17 Missing and 13 partials ⚠️
ultraplot/gridspec.py 93.93% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@gepcel

gepcel commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator

The fix messed up the spaces between rows of axes, when using shared titles with subset of axes.

@cvanelteren

Copy link
Copy Markdown
Collaborator Author

@gepcel do you have an example?

@cvanelteren

Copy link
Copy Markdown
Collaborator Author
import ultraplot as uplt

# Test whether ignored for bar plots
fig, ax = uplt.subplots(ncols=2, nrows=2)
ax[0, :].format(title="True")
ax[1, :].format(title="True")
uplt.show(block=1

Looks good I think

@cvanelteren

Copy link
Copy Markdown
Collaborator Author
image

@gepcel

gepcel commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator
fig,ax=pplt.subplots(ncols=4, nrows=2, refwidth=1)
ax[:,:3].format(title="A test title")
image

@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Thanks! Funnily enough the code works fine when index to the first row. Will investigate.

@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Found the issue; it was feeding back into tight layout causing the figure to act as if the text was still there, overinflating the hspace.

@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Good catch @gepcel

@cvanelteren cvanelteren merged commit a1bb307 into main Apr 7, 2026
16 of 19 checks passed
@cvanelteren cvanelteren deleted the feature/shared-subplot-title branch April 7, 2026 22:33
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.