In [1]:
import vincent
vincent.core.initialize_notebook()
In [3]:
list_data = [10, 20, 30, 20, 15, 30, 45]
bar = vincent.Bar(list_data)
bar.display() # each time you type this, the graph appears
bar.to_json("BarGraph_Sample.json")
In [19]:
world_topo = r'world-countries.topo.json'
geo_data = [{'name': 'countries',
'url': world_topo,
'feature': 'world-countries'}]
vis = vincent.Map(geo_data=geo_data, scale=200)
vis.display()
In [20]:
county_topo = r'us_counties.topo.json'
state_topo = r'us_states.topo.json'
geo_data = [{'name': 'counties',
'url': county_topo,
'feature': 'us_counties.geo'},
{'name': 'states',
'url': state_topo,
'feature': 'us_states.geo'}]
vis = vincent.Map(geo_data=geo_data, scale=1000, projection='albersUsa')
del vis.marks[1].properties.update
vis.marks[0].properties.update.fill.value = '#084081'
vis.marks[1].properties.enter.stroke.value = '#fff'
vis.marks[0].properties.enter.stroke.value = '#7bccc4'
vis.display()
In [27]:
state_topo = r'us_states.topo.json'
geo_data = [
{'name': 'states',
'url': state_topo,
'feature': 'us_states.geo'}]
vis = vincent.Map(geo_data=geo_data, scale=1000, projection='albersUsa')
#del vis.marks[1].properties.update
vis.marks[0].properties.update.fill.value = '#6600CC'
#vis.marks[1].properties.enter.stroke.value = '#fff'
vis.marks[0].properties.enter.stroke.value = '#7bccc4'
vis.display()
In [3]:
zip_topo = r'zips_us_topo.json'
geo_data = [
{'name': 'states',
'url': zip_topo,
'feature': 'zip_codes_for_the_usa'}]
vis = vincent.Map(geo_data=geo_data, scale=1000, projection='albersUsa')
#del vis.marks[1].properties.update
#vis.marks[0].properties.update.fill.value = '#6600CC'
#vis.marks[1].properties.enter.stroke.value = '#fff'
#vis.marks[0].properties.enter.stroke.value = '#7bccc4'
vis.display()
In [2]:
In [ ]: