Reputation: 23
I am trying to run the following code in Pycharm 2018.1.1 communtity :
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv('pokemon.csv')
data.Speed.plot(kind = 'line', color = 'g',label = 'Speed',linewidth=1,alpha = 0.5,grid = True,linestyle = ':')
data.Defense.plot(color = 'r',label = 'Defense',linewidth=1, alpha = 0.5,grid = True,linestyle = '-.')
plt.legend(loc='upper right') # legend = puts label into plot
plt.xlabel('x axis') # label = name of label
plt.ylabel('y axis')
plt.title('Line Plot') # title = title of plot
So when I press the run button to run the file pokemons.py it is just show the message: Process finished with exit code 0
and doesnt output any plot (which is what the above code suppossed to do).
Upvotes: 1
Views: 150
Reputation: 4440
it helped me while had the same problem
plt.show(block=True)
plt.interactive(False)
or alternatively only add
plt.show()
Upvotes: 2