在 pycharm 中绘制数据框(pandas),不显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29042276/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 23:02:54  来源:igfitidea点击:

Plotting a dataframe (pandas) in pycharm, not displaying

pythonpandasmatplotlibpycharm

提问by jason m

My data looks like the following when I printit.

我的数据如下所示print

print data

print data

                  A               B
2014-04-04      0.000000       0.000000
2014-06-11      0.013416      -0.049643
2014-12-22      0.175361      -0.114184
2014-03-25     -0.160409       0.208127
2014-11-03      0.168943      -0.157301
2014-06-16     -0.130902       0.109455

pd.scatter_matrix(data, diagonal='kde', figsize=(10, 10))

pd.scatter_matrix(data, diagonal='kde', figsize=(10, 10))

where pd = import pandas as pd

在哪里 pd = import pandas as pd

There are no errors thrown but i do not see the chart anywhere(?).

没有抛出任何错误,但我在任何地方都看不到图表(?)。

The data is "chartable" as matplotlib.pyplot works. Matplotlib is only displayed when I call matplotlib.pyplot.plt.show().

当 matplotlib.pyplot 工作时,数据是“图表”。Matplotlib 仅在我调用matplotlib.pyplot.plt.show().

I am assuming the plot is not being shown, but then how do i "show" it?

我假设情节没有被显示,但是我如何“显示”它?

Edit: I am working from thisexample.

编辑:我正在从这个例子中工作。

thanks

谢谢

回答by jason m

plt.show()must be called where import matplotlib.pyplot as plt

plt.show()必须在何处调用 import matplotlib.pyplot as plt