vega

Getting ggvis::export_png() working

主宰稳场 提交于 2019-12-01 04:36:57
Goal Export a ggvis figure as a PNG file (for inclusion in an .Rmd document). Problem I know essentially nothing about Node.js, other than that it is great and I should know more. I get as far as: library(ggvis) mtcars %>% ggvis(~mpg, ~wt) %>% export_png() Writing to file plot.png Guessing layer_points() module.js:340 throw err; ^ Error: Cannot find module 'd3' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/local/src/vega/index.js:11:6) at Module.

How can I make a map using GeoJSON data in Altair?

时光毁灭记忆、已成空白 提交于 2019-11-30 18:25:01
问题 I'm very new to mapping, and to Altair/Vega. There's an example in the Altair documentation for how to make a map starting with an outline of US states, which is created basically with: states = alt.topo_feature(data.us_10m.url, feature='states') # US states background background = alt.Chart(states).mark_geoshape( fill='lightgray', stroke='white' ) but I want to plot points in the British Isles, instead. Since there are only US and World maps in the vega data collections, I would have to

Unable plot with vincent in IPython

前提是你 提交于 2019-11-27 18:20:01
问题 Trying to plot sample plot with vincent in IPython: import vincent vincent.core.initialize_notebook() list_data = [10, 20, 30, 20, 15, 30, 45] bar = vincent.Bar(list_data) bar.display() and nothing happens. Is there any special settings in IPython I need to enable to do it? An I need to disable inline option? 回答1: vincent.core.initialize_notebook() is hard-coded to import its Javascript libraries from CDNs over unsecured HTTP. This will fail if you are accessing your notebook server over