0

I am trying to plot some scientific data by using Matplotlib in terminal. here is my simple code :

   import matplotlib.pyplot as plt 
   plt.plot([1,2,3],[3,2,5])
   plt.show(block=True)

But I can't see any graph on my linux. I am using wsl on windows for linux. debian is my linux.

The link below doesn't help my problem: Matplotlib plots aren't shown when running file from bash terminal

as you see I set block to True and nothing! for now I am using plt.savefig() function to see my result in windows. may be I need to install some software in my Linux for image viewer , no?

thank you

meysamimani
  • 315
  • 2
  • 12
  • Have you configured a GUI for wsl? – frippe Oct 07 '21 at 05:12
  • No, I am very new to Linux. could you give me a short guide how it should be done – meysamimani Oct 07 '21 at 05:16
  • it should be done inside linux? or I need to do some setup in windows? – meysamimani Oct 07 '21 at 05:20
  • I found the link " https://www.youtube.com/watch?v=J4Giu5iWigQ " explaining about gui in wsl , do you think it's the same as what you are saying for my problem? – meysamimani Oct 07 '21 at 05:36
  • 1
    How to setup a GUI in wsl is a different question, so if you run into problems with that you should post a new one. That said, the internet is full of tutorials on how to set it up. Do note that there's wsl and wsl2. Check which one you're using and go with a tutorial for that. – frippe Oct 07 '21 at 05:55

0 Answers0