vega-lite

Scale Y axis of Altair chart to interactive legend selection

Scale Y axis of Altair chart to interactive legend selection Question: I’ve copied the interactive legend code from here: https://altair-viz.github.io/gallery/interactive_legend.html The difference is that my data has different orders of magnitude for the different series, so it would be nice if, when we select a set of series (shift click), we zoom the graph so …

Total answers: 1

Can mark_geoshape () be used for Canadian Provinces/cities?

Can mark_geoshape () be used for Canadian Provinces/cities? Question: I’m looking to somehow figure out a way to insert a geographic graph of British Columbia which is a part of Canada in my data analysis. I have made this image here explaining what tree is being planted the most in Vancouver Now I want to …

Total answers: 3

Altair choropleth – Get geometry from transform_lookup

Altair choropleth – Get geometry from transform_lookup Question: I am trying to draw a choropleth map of municipalties in Denmark with color encoded as a sum of crimes in that municipalty. I have several entries for each municipalty since the data is over a time-period and types of crime and I have a single geometry …

Total answers: 2

Changing the width of a step in Altair line and area charts

Changing the width of a step in Altair line and area charts Question: I try to build a line chart that displays a value for each month of a full year. I also want to fill months that exceed a threshold. I have an issue with the appearance of the last values of both the …

Total answers: 1

Python Altair Generate a table on selection

Python Altair Generate a table on selection Question: I have a histogram with a bunch of binned data and I was wondering if it would be possible to say generate a table if I select a bar from the histogram and it would display the data as it is in the original dataframe. Asked By: …

Total answers: 2

Plotly express vs. Altair/Vega-Lite for interactive plots

Plotly express vs. Altair/Vega-Lite for interactive plots Question: Recently I am learning both Plotly express and Altair/Vega-Lite for interactive plotting. Both of them are quite impressive and I am wondering what their strengths and weaknesses are. Especially for creating interactive plots, are there any big differences between them and when is one more suitable than …

Total answers: 2

Using Altair on data aggregated from large datasets

Using Altair on data aggregated from large datasets Question: I am trying to histogram counts of a large (300,000 records) temporal data set. I am for now just trying to histogram by month which is only 6 data points, but doing this with either json or altair_data_server storage makes the page crash. Is this impossible …

Total answers: 3

strange year values on X axis

strange year values on X axis Question: If I use the vega dataset “disasters” and make a straightforward chart, I get some weird values for year. In Altair the code is: import altair as alt from vega_datasets import data dis=data.disasters() alt.Chart(dis).mark_bar().encode( x=alt.X(‘Year:T’), y=alt.Y(‘Deaths’), color=’Entity’ ) (vega editor link) Asked By: campo || Source Answers: Year …

Total answers: 2