add 'return fig' to plot functions
See original GitHub issue🚀 Feature In visualization.py plot_subject and plot_volume is it possible de return the matplotlib fig ?
'if output_path is not None:
fig.savefig(output_path)
if show:
plt.show()
return fig
Motivation To send the figure to an experiment tracker.
thank you
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to have a function return a figure in Python (using ...
Call plot(x, y) method and store the figure instance in a variable, f. To display the figure, use show() method. Example. import numpy...
Read more >Matplotlib returning a plot object - python - Stack Overflow
A great way to do this is to pass a figure object to your code and have your function add an axis then...
Read more >How to Return a Plot or Figure in Python Matplotlib? - Finxter
Basic Solution · Create a function my_plot(x, y, ...) with arguments to customize your plot (e.g., the plot's x and y data, color,...
Read more >Creating custom plotting functions with matplotlib
TLDR: Define your own functions that involve plotting onto a specific axes with the following ... return(ax)plt.figure(figsize=(10, 5))
Read more >Pyplot tutorial — Matplotlib 3.6.2 documentation
MATLAB, and pyplot , have the concept of the current figure and the current axes. All plotting functions apply to the current axes....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I opened a pull request: https://github.com/fepegar/torchio/pull/872
I also use something like this in my code to send images to an experiment tracker (ClearML for example). Would be a nice addition to torchio