Skip to content

Add support to set figure title in plot method #1306

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 12 commits into from
Jun 16, 2025

Conversation

toufiqmusah
Copy link
Contributor

Description

Included plt.suptitle() to the plot_volume() method in visualization.py, to enable plotting subjects with a main title.
Added two args (figtitle: str None, fig title_y:int 0.75).

Here is a GitHub Gist of it working, along with tests.

No title:
image

Title:
image

Checklist

  • I have read the CONTRIBUTING docs and have a developer setup ready
  • Changes are
    • Non-breaking (would not break existing functionality)
    • Breaking (would cause existing functionality to change)
  • Tests added or modified to cover the changes
  • In-line docstrings updated
  • Documentation updated
  • This pull request is ready to be reviewed

Copy link
Member

@fepegar fepegar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @toufiqmusah.

@fepegar fepegar changed the title Add figtitle to .plot() Add support to set figure title in plot method Jun 16, 2025
@fepegar fepegar merged commit cda1934 into TorchIO-project:main Jun 16, 2025
21 of 22 checks passed
@fepegar
Copy link
Member

fepegar commented Jun 16, 2025

Thanks for your contribution, @toufiqmusah.

@allcontributors please add @toufiqmusah for code

@fepegar
Copy link
Member

fepegar commented Jun 16, 2025

@allcontributors please add @toufiqmusah for code

Copy link
Contributor

@fepegar

I've put up a pull request to add @toufiqmusah! 🎉

@toufiqmusah
Copy link
Contributor Author

@fepegar Thanks for the merge.

Though I will have to address the issue of the y offset. You were right to callout the hardcoded value probably affecting examples like FPG. The current implementation only works will when viewing subjects with two rows ore more (like FPG).

I will work on a fix in the coming days and make an update.

image

image

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.

2 participants