Matplotlib plots not showing in VS Code

We Are Going To Discuss About Matplotlib plots not showing in VS Code. So lets Start this Python Article.

Matplotlib plots not showing in VS Code

  1. How to solve Matplotlib plots not showing in VS Code

    When you are plotting a graph in a script, make sure to use the following command to output the window displaying the graph.
    plt.show()
    By default, Jupyter outputs the graph, even when plt.show() is not explicitly called

  2. Matplotlib plots not showing in VS Code

    When you are plotting a graph in a script, make sure to use the following command to output the window displaying the graph.
    plt.show()
    By default, Jupyter outputs the graph, even when plt.show() is not explicitly called

Solution 1

When you are plotting a graph in a script, make sure to use the following command to output the window displaying the graph.

plt.show()

By default, Jupyter outputs the graph, even when plt.show() is not explicitly called.

Original Author arhr Of This Content

Solution 2

In Visual Studio Code Jupyter Notebooks you may see something like this:

enter image description here

in order to show the plot you may click on the

</>

symbol to the left and change the the mime type to image/png (Jupyter renderer).
Now the plot appears.

Original Author cbueltem Of This Content

Solution 3

Try the latest version of matplotlib

pip install matplotlib --upgrade

This works good for me.

Original Author python_geek Of This Content

Solution 4

Maybe you can try changing the Output Mimetype to one with an option with an image. It must be plain/text for you for that cell. You can change it for different cells from their options.
enter image description here

Original Author Dhruv Darda Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment