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_slm_results #284

Closed
mohammadhadiaarabi opened this issue May 7, 2022 · 1 comment
Closed

plot_slm_results #284

mohammadhadiaarabi opened this issue May 7, 2022 · 1 comment

Comments

@mohammadhadiaarabi
Copy link

Dear Developer,
When I run Tutorial 01: Linear Models notebook file, the plot_slm_results couldn't visualize results and only print:
[<IPython.core.display.Image object>,
<IPython.core.display.Image object>,
<IPython.core.display.Image object>,
<IPython.core.display.Image object>]
I tested this tutorial in windows and Linux and unfortunately, this function couldn't show the results.
It seems the first line "%matplotlib inline" is not sufficient to visualize the figures.
Best,
Mohammad

@zihuaihuai
Copy link
Collaborator

zihuaihuai commented Sep 27, 2024

Dear Mohammad,

Thank you for bringing this issue to our attention.

The behavior you're experiencing—where plot_slm_results returns a list of <IPython.core.display.Image object> instead of displaying the figures—is due to how the images are being handled within the Jupyter notebook environment. The plot_slm_results function returns a list of IPython Image objects, but they are not automatically displayed in the notebook output.

Here's how you can resolve this issue:


# Assuming 'slm' is your fitted model
images = plot_slm_results(slm)

# Loop through and display each image
for img in images:
    display(img)

This will display each image returned by plot_slm_results directly in your notebook.

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

No branches or pull requests

2 participants