【发布时间】:2017-03-04 19:42:47
【问题描述】:
我无法弄清楚我的 jupyter 笔记本上的内容。 Vincent 和 Bokeh 工作正常,但在试用 Altair 时,我一定遗漏了一些东西,但我没有出错,在线文档也没有提到我的问题。
这是我输入的内容(来自文档页面 https://altair-viz.github.io/gallery/bar_aggregate.html)
from altair import *
Chart('http://vega.github.io/vega-lite/data/population.json',
description='A bar chart showing the US population distribution of age groups in 2000.',
).mark_bar().encode(
x=X('sum(people):Q',
axis=Axis(
title='population',
),
),
y=Y('age:O',
scale=Scale(
bandSize=17.0,
),
),
).transform_data(
filter='datum.year == 2000',
)
代码在我的 Jupyter 笔记本中执行,没有错误,但也没有图表。我确实安装了 vega,所以这不是问题。它不是特定于该图,其他示例具有相同的行为。我什至不知道如何解决这个问题!
【问题讨论】:
-
你使用 anaconda 吗?根据stackoverflow.com/questions/38535357/… 可能有一个链接。我在使用 Anaconda3-4.2.0-Windows-x86_64 时遇到了同样的问题。
标签: python-2.7 jupyter vega