How to show matplotlib images in Visual Studio 2019 with Python

Gilad Pellaeon 1 Reputation point

Atm I learn Python to do ML. I use Visual Studio 2019 as IDE (not Visual Studio code!). To show image data I installed and imported matplotlib. Here is an excerpt how I call matplotlib

. . .

for image_batch, label_batch in dataset.take(1):

My example code runs without an error. But the program only prints text in the console. There is no windows showing my picture. I tried to find a solution how to use matploblib in Visual Studio, but I only found information about how to achieve it in Visual Studio Code. What must I do or which extension must install to see the plotted images?

Best regards

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,157 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PengGe-MSFT 3,276 Reputation points

    Hi, @Gilad Pellaeon

    Welcome to Microsoft Q&A!

    You can try to add the following content to your code:  

    Then try to run again.

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments