Matplotlib chart doesn't display in PyCharm
Instead of a chart, PyCharm outcome is <Figure size 1000x1000 with 1 Axes>. The Jupyter Notebook (jupyter.org) displays the chart correctly. Plt.show() doesn't help. %matplotlibe inline is before importing the matplotlib library.
Please sign in to leave a comment.
Which PyCharm version are you using?
Could you please provide a code sample to reproduce the issue?
I use the last version of PyCharm Professional (2021.3.1).
Here is some code example:
Thank you,
There is a known issue with ipywidgets - https://youtrack.jetbrains.com/issue/DS-2766
Though the widget doesn't work, the graph is displayed correctly in my case, using your code sample:
If the issue is still relevant, could you please let me know your python version, and the output of `pip freeze` ?
I found that matplotlib needed to have a ENV variable set or this code
matplotlib.use('TkAgg')
to show the plot window on windows10 in pycharm.
@conradbraam that was a great hint for me as well, plots showing up in pop up windows.
But the strange thing was that one showed up in application (Plot tab) but the other did not. What was the difference?
was missing from the one that did not work without TkAgg!
Looking at your code above
plt.show()
is missing from both.