Unable to display plots in Pycharm (running with Anaconda on Windows Subsystem for Linux) Follow
Hello,
I am having a problem displaying plots/images in Pycharm. I am running Anaconda on Windows Subsystem for Linux. I've tried the code (below) to try to change the matplotlib backend, but that didn't seem to help.
I have set "DISPLAY:True" in my environment variables.
I have turned on "Scientific Mode".
Any ideas on how I can fix this?
Thank you,
Jeremy
import matplotlib
matplotlib.get_backend()
Out[3]: 'module://backend_interagg'
matplotlib.use('Gtk3Agg')
matplotlib.get_backend()
Out[5]: 'GTK3Agg'
import matplotlib.pyplot as plt
import skimage
img = skimage.io.imread('/awlab/project/2019_09_cancer_arrest/plates/JC_20190904_expt_77_b_FUCCI_plate_2019024077_t001/bgs_images/B2/JC_20190904_expt_77_b_FUCCI_plate_2019024077_t001_B2_0000-1.png')
plt.imshow(img)
Out[9]: <matplotlib.image.AxesImage at 0x7f1547d2d7b8>
plt.show()
Please sign in to leave a comment.
Hi,
Does the following code work?
Is the plot shown in PyCharm?
If not, please share idea.log file from Help | Show Log in...
You shared very excellent information. It was a very helpful article for. Keep sharing more with us. Norton setup
Hi Sergey—
Thank you for the quick response! I don't know why, but for some reason, everything works now, and I see the plots. Maybe I just needed to close everything and restart it for some reason.
Best,
Jeremy
Good to hear that you finally got your solution. But if you ever face any further problem you can contact me, I am currently working as a geek squad tech support team member and will definitely help you out.
In my case, it started to work when I ran the offending script in DEBUG MODE. After that it would also show plots in scientific mode.