altair

Broken axis in Altair/Vega

ⅰ亾dé卋堺 提交于 2019-12-11 08:47:23
问题 I have a Normalized Stacked Area Chart with huge differences between one variable and the others like: df1=pd.DataFrame.from_dict( {'YEAR': {0: 2010, 1: 2010, 2: 2010, 3: 2010, 4: 2011, 5: 2011, 6: 2011, 7: 2011, 8: 2012, 9: 2012, 10: 2012, 11: 2012, 12: 2013, 13: 2013, 14: 2013, 15: 2013}, 'impact_FU': {0: 0.031479085164086554, 1: 5.9856927170853295e-05, 2: 1.1035885271638534e-05, 3: 5.8233509026863169e-06, 4: 0.059176271387395112, 5: 0.00011179170132430088, 6: 1.9783914536689014e-05, 7: 1

Altair/Vega-Lite bar chart: filter top K bars from aggregated field

删除回忆录丶 提交于 2019-12-10 11:34:51
问题 I'm visualizing a dataset that has, for instance, a categorical field. I want to create a bar chart that shows the different categories for that field with their cardinality, sorted in 'ascendind'/'descending' order. This can simply be achieved with altair : import pandas as pd import altair as alt data = {0:{'Name':'Mary', 'Sport':'Tennis'}, 1:{'Name':'Cal', 'Sport':'Tennis'}, 2:{'Name':'John', 'Sport':'Tennis'}, 3:{'Name':'Jane', 'Sport':'Tennis'}, 4:{'Name':'Bob', 'Sport':'Golf'}, 5:{'Name

How to create a grouped bar chart in Altair?

橙三吉。 提交于 2019-12-06 01:43:12
问题 How does one create a grouped bar chart in Altair? I'm trying the following but it is just producing two graphs side by side. Chart(data).mark_bar().encode( column='Gender', x='Genre', y='Rating', color='Gender' ) 回答1: Example of group bar chart I show a simplified example of Grouped Bar Chart from Altair's documentation. You can also see the full documentation here. Basically, you have to specify x-axis Gender (F or M in each subplot), y-axis as Rating and Genre as Column . from altair

How to create a grouped bar chart in Altair?

こ雲淡風輕ζ 提交于 2019-12-04 06:50:28
How does one create a grouped bar chart in Altair? I'm trying the following but it is just producing two graphs side by side. Chart(data).mark_bar().encode( column='Gender', x='Genre', y='Rating', color='Gender' ) titipata Example of group bar chart I show a simplified example of Grouped Bar Chart from Altair's documentation. You can also see the full documentation here . Basically, you have to specify x-axis Gender (F or M in each subplot), y-axis as Rating and Genre as Column . from altair import * import pandas as pd # create dataframe df = pd.DataFrame([['Action', 5, 'F'], ['Crime', 10, 'F

How to create a nested Grouped Bar Chart using Altair? - Added sample data

不打扰是莪最后的温柔 提交于 2019-12-02 17:53:12
问题 <table class="table table-bordered table-hover table-condensed"> <thead><tr><th title="Field #1">year</th> <th title="Field #2">primary_type</th> <th title="Field #3">Number_of_Incidents</th> <th title="Field #4">number_of_arrests</th> <th title="Field #5">percent_arrest</th> <th title="Field #6">rank</th> </tr></thead> <tbody><tr> <td align="right">2018</td> <td>THEFT</td> <td align="right">57330</td> <td align="right">5503</td> <td align="right">9.6</td> <td align="right">1</td> </tr> <tr>

How to create a nested Grouped Bar Chart using Altair? - Added sample data

点点圈 提交于 2019-12-02 13:44:28
<table class="table table-bordered table-hover table-condensed"> <thead><tr><th title="Field #1">year</th> <th title="Field #2">primary_type</th> <th title="Field #3">Number_of_Incidents</th> <th title="Field #4">number_of_arrests</th> <th title="Field #5">percent_arrest</th> <th title="Field #6">rank</th> </tr></thead> <tbody><tr> <td align="right">2018</td> <td>THEFT</td> <td align="right">57330</td> <td align="right">5503</td> <td align="right">9.6</td> <td align="right">1</td> </tr> <tr> <td align="right">2018</td> <td>BATTERY</td> <td align="right">44667</td> <td align="right">8886</td>

AVEVA Bocad 3.2.0.4 1DVD+AVEVA Bocad NC 8.1.0 1CD

纵饮孤独 提交于 2019-12-02 07:57:31
Keysight SystemVue 2020 ENG Win64 1DVD Siemens.Simcenter.SPEED.14.04.013.Windows 1CD Siemens.Tecnomatix.RealNC.8.7.Windows 1CD AQTESOLV Pro 4.5 1CD Geometric.NestingWorks.2019.SP2.0.Win64 1DVD InnovMetric.PolyWorks.Metrology.Suite.2019.IR5.Win32_64 2DVD Siemens.Simcenter.TestLab.2019.1.Win32_64 1DVD 来电(TEL):18980583122 Ce.A.S. s.r.l. ParatiePlus v20.0.0 1CD Cadence SPB v17.40.000-2019 Win64 1DVD PTC Creo EMX 10.0 M040 for Creo 4.0 Win64 1CD Siemens.NX.1888.Win64 2DVD SIMULIA.Suite.2019.HF5.Update.Only.Win64.&.Linux64 2DVD Altair FluxMotor 2019.0.2 HotFix Win64 1CD Blackmagic Design DaVinci

How do you set Axis FontSize in Altair?

荒凉一梦 提交于 2019-12-01 05:36:02
问题 I would like to increase the X-Axis (or Y-Axis for that matter) fontSize to 16 (or any value) in the following Altair graph. I could not find any example in the Altair documentation here: https://altair-viz.github.io/index.html. I am using Jupyter Lab for visualization. Intuitively alt.Axis should take FontSize argument import altair as alt from vega_datasets import data cars = data.cars() alt.Chart(cars).mark_point().encode( alt.X('Horsepower', axis=alt.Axis(title="HORSEPOWER")), alt.Y(

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

Increasing bar width in bar chart using Altair

依然范特西╮ 提交于 2019-11-30 18:03:45
问题 I have the following dataframe and want to use altair library in Python to plot my bar chart. However, I couldn't figure out how to expand the width of each bar (same as width=0.5 parameter in matplotlib ). import pandas as pd from altair import * ls = [[ 1, 734], [ 2, 1705], [ 3, 2309], [ 4, 2404], [ 5, 2022], [ 6, 1538], [ 7, 1095], [ 8, 770], [ 9, 485], [ 10, 312], [ 11, 237], [ 12, 153], [ 13, 103], [ 14, 69], [ 15, 47], [ 16, 39], [ 17, 43], [ 18, 28], [ 19, 18]] df = pd.DataFrame(ls,