Skip to content
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

plot_boxplots returns nothing if not set to return figure #702

Open
shihsama opened this issue Jan 19, 2025 · 0 comments
Open

plot_boxplots returns nothing if not set to return figure #702

shihsama opened this issue Jan 19, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@shihsama
Copy link

shihsama commented Jan 19, 2025

Hi @johannesostner ,
So glad to see this integrative work! I'm an old user of scCODA. Hence, I noticed a change in boxplot function. In the old scCODA, if we set plot_facets = True, then it would return a FacetGrid object so that we can modify specific subplot. However, in pertpy, the plot_boxplots function does not return FacetGrid if we set plot_facets = True and return_fig= False. It actually returns NoneType. So I checked the differences between the source codes of pertpy and scCODA.
I found plot_boxplots would not return FacetGrid in the end even if we set plot_facets = False. I believe here is the rub.
Another issue is that the argument show = True is somewhat redundant. After removing it, we are able to modify titles of subplots.

The original codes in the end:

    if show:
        plt.show()
    if return_fig:
        return plt.gcf()
    return None

Codes modified:

    if return_fig:
        return plt.gcf()
    else:
        return g
    return None

###The arguement show = True should also be removed.

In this way, it finally returns <seaborn.axisgrid.FacetGrid> when we set plot_facets = False and plot_facets = True.
Thanks for reviewing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants