How display plots in PyCharm Community edition

Viewed 275

I was needed to switch from RStudio (R) to PyCharm Community Edition (Python 3.9). I liked the 2 features of RStudio: 1)it is possible to run code line by line (output of previous lines is stored in the environment) and 2) you can easily see stored dataframe/lists/vectors in the environment window. Right now I am trying to find the same functionality in Pycharm. I found that 1) running a code line by line can be done via Shift+Alt+E (Windows). At the same time if Ipress ´Python Console´ on the bottom, then I also see a window (bottom right), which shows stored variables. As a result, the functionality is a little bit the same as in RStudio.

The problem is that when I press Shift+F19 (Run the whole file at one press) then Pycharm will display a plot in separate window. However, if I run each line separately using Shift+Alt+E then nothing appears. Could you tell why is the problem arises? Are there other options in Pycharm in order to obtain the the same functionality I am looking for (except option with the use of the debugger)?

import matplotlib.pyplot as plt
x = [1,2,3,4,5,6,7,8]
y = [0.1,0.2,0.5,0.6,0.7,0.8,0.9,1.3]
plt.plot(x,y)
plt.show()
0 Answers
Related