简体   繁体   English

Python datascience.tables.Table.plot 不显示图表

[英]Python datascience.tables.Table.plot does not show the graph

Don't know why the graph is not showing up.不知道为什么图表没有显示。 There is no error message at all.根本没有错误信息。 I have tried both in command line and jupyter in Visual Source Code.我在 Visual Source Code 中尝试了命令行和 jupyter。 Nothing is showing up.什么都没有出现。

import datascience as ds

table = ds.Table().with_columns(
    'days',  ds.make_array(0, 1, 2, 3, 4, 5),
    'price', ds.make_array(90.5, 90.00, 83.00, 95.50, 82.00, 82.00),
    'projection', ds.make_array(90.75, 82.00, 82.50, 82.50, 83.00, 82.50))

table.plot('days')

Do I miss anything?我想念什么吗? Any suggestions?有什么建议么? Thanks in advance.提前致谢。

Found the solution, in jupyter I have to add the following at the top to make the inline graph shows up.找到了解决方案,在 jupyter 中,我必须在顶部添加以下内容才能显示内联图。

%matplotlib inline. %matplotlib 内联。

Below is the complete code.下面是完整的代码。 Please noted the code on the 2nd line.请注意第二行的代码。

import datascience as ds
%matplotlib inline

table = ds.Table().with_columns(
    'days',  ds.make_array(0, 1, 2, 3, 4, 5),
    'price', ds.make_array(90.5, 90.00, 83.00, 95.50, 82.00, 82.00),
    'projection', ds.make_array(90.75, 82.00, 82.50, 82.50, 83.00, 82.50))

table.plot('days')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM