question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dmuscommented, May 6, 2022
1reaction
dmuscommented, May 4, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found