Pycharm does not show plot

后端 未结 25 1054
鱼传尺愫
鱼传尺愫 2020-12-04 09:13

Pycharm does not show plot from the following code:

import pandas as pd
import numpy as np
import matplotlib as plt

ts = pd.Series(np.random.randn(1000), in         


        
相关标签:
25条回答
  • 2020-12-04 09:22

    Just add plt.pyplot.show(), that would be fine.

    The best solution is disabling SciView.

    0 讨论(0)
  • 2020-12-04 09:22

    I'm using Ubuntu and I tried as @Arie said above but with this line only in terminal:

    sudo apt-get install tcl-dev tk-dev python-tk python3-tk
    

    And it worked!

    0 讨论(0)
  • 2020-12-04 09:24

    In non-interactive env, we have to use plt.show(block=True)

    0 讨论(0)
  • 2020-12-04 09:25

    I had the same problem. Check wether plt.isinteractive() is True. Setting it to 'False' helped for me.

    plt.interactive(False)
    
    0 讨论(0)
  • 2020-12-04 09:26
    import matplotlib
    matplotlib.use('TkAgg')
    

    Works for me. (PyCharm/OSX)

    0 讨论(0)
  • 2020-12-04 09:28

    I tried different solutions but what finally worked for me was plt.show(block=True). You need to add this command after the myDataFrame.plot() command for this to take effect. If you have multiple plot just add the command at the end of your code. It will allow you to see every data you are plotting.

    0 讨论(0)
提交回复
热议问题