Can't load image in PyCharm's Jupyter notebook
The image often don't show up properly when using jupyter notebook in Pycharm. However, everything goes well in VS code jupyter notebook.
By "image" do you mean geom_imshow() or not a specific "geom" but any lets-plot figure?
Do you pass any values to LetsPlot.setup_html() call in the head of the notebook?
I am using ggplot() + geom_xxx() function to draw images in the Jupyter notebook.
When I set LetsPlot.setup_html(offline=True), both PyCharm and VS code works fine for me, but the image is coarse.
When I set LetsPlot.setup_html(offline=False), only Jupyter notebook in VS code works fine and the notebook in PyCharm can't load the image at all.
Thank you!
My guess is that PyCharm blocks the notebook' access to the internet.
Please make sure you have "Trusted" checkbox selected in the notebook' toolbar:
And you can call setup_html() with no parameters: LetsPlot.setup_html(). As long as you are on-line that is.
Thank you alshan. After selecting the "Trusted" checkbox, PyCharm does load the output image. However, the image is of poor quality and not clear enough, which just looks like that let-plot still works in an offline mode.
Is it a problem of computer memory? Can I do something to improve the quality of the output image?
Thank you.
Could you try to export to SVG : ggsave(p, "a.svg")
and then open this svg file in PyCharm or in a browser?
Could you try to export to SVG :
ggsave(p, "a.svg")and then open this svg file in PyCharm or in a browser?
After saving the plot to a svg file and opening it, the image quality is as good as I want. I seems that it is a problem of PyCharm. Can I do something else to view high quality image in PyCharm directly?
Thank you.
Can't say what else we can do. On my macbook retina display plots look perfect in PyCharm. If you have 4K monitor than there might exist some settings allowing to improve the picture quality at the expense of performance perhaps. I recommend to contact PyCharm support.
Thank you! I will contact PyCharm support.