Skip to main content

Questions tagged [altair]

Altair is a declarative statistical visualization library for Python, based on Vega-Lite. It provides a high-level API for creating complex visualizations with minimal code. Please include code and sample data in your question.

0 votes
1 answer
97 views

Altair choropleth not rendering in streamlit app on Snowflake and color coding problem

I am trying to make a choropleth map in a streamlit app on Snowflake. Outside of snowflake, I can use the following code to render a map where just one county in Alabama is color coded. import ...
jh_'s user avatar
  • 103
0 votes
0 answers
24 views

Altair - display lines on a mouseover

I'm trying to display lines (link between centroïd and points) on a map only if I pass my mouse over. But I still don't get why it doesn't work. Do you know any other function with Altair to do it ...
Charlotte CUPILLARD's user avatar
0 votes
0 answers
34 views

How to fix altair transform_filter()?

I'm trying to create a choropleth map of the US displaying the percentages of the population with different disabilities. However, using the drop-down selection tool bar makes the data/color of the ...
pwiaduck's user avatar
1 vote
0 answers
60 views

Select zoom axis per drop-down menu

I have a scatterplot in which I want to zoom on either the y axis, the x axis or both. I would like the user to select this behavior via a dropdown menu.The standard setting would be both like ....
Golanu Delamare's user avatar
0 votes
0 answers
28 views

Altair sorting not working properly on faceted chart

I have some faceted bar graphs displaying the amounts of different colors in different paintings. base = alt.Chart(df).mark_bar().encode( x=alt.X( 'color', title='', ...
herpderp's user avatar
  • 16k
2 votes
1 answer
140 views

Efficient interactive plots of large datasets -- which framework to use?

I have a moderate-to-large dataset of ~500k points which I would to visualize with an interactive 2d scatterplot (ideally through a web-app). Usually am quite fond of the altair package (Python) for ...
John Titor's user avatar
1 vote
1 answer
58 views

Table with multi-line strings in Altair

I was trying to write a table with some entries being multi-line using altair, but seem to get into trouble with fixing line spacing. For example: text_df = pd.DataFrame({"a":["very ...
Devil's user avatar
  • 959
0 votes
0 answers
49 views

Convert seconds to days, hours, etc on axis labels

I am trying to plot a chart which needs to have duration times in terms of "days, hours, minutes" on the Y axis and just dates on the X axis. I can do this easily if the duration is ...
Tommaso Pasini's user avatar
1 vote
2 answers
89 views

Custom ordering in a grouped bar chart not applied in Altair?

I am trying to achieve a custom sort order for a series of categories in a grouped bar chart. An issue on GitHub from a few years ago suggests how to do this: by supplying a list with the custom sort ...
bertieb's user avatar
  • 198
1 vote
0 answers
25 views

How modify altair multiple tooltip by y values

I'm looking to customize the tooltips in my Altair chart. I have two specific requirements: Order the tooltip lines based on the value of the element, and hide certain tooltip lines depending on their ...
Saint-malo's user avatar
1 vote
1 answer
44 views

Consolidating multiple color legends in layered and faceted Altair plots

In Altair, if I layer two plots with color scales on different attributes and then also facet them I end up with multiple copies of the color legend. If there's just one color scale it correctly ...
kfor's user avatar
  • 358
1 vote
1 answer
36 views

Overlaid boundary and point Altair plots are not aligning

I've got a layer map plot in Altair of London that I was struggling to flip - Solving upside plot and projection problems in Geopandas and Altair However, a more troubling problem is that I've got a ...
elksie5000's user avatar
  • 7,580
0 votes
1 answer
61 views

Dynamic label with number of points in scatterplot based on transform selection in Altair?

tl;dr: is there a way to get a dynamic count of points in filtered plots in Altair? In the 'filtering by selection' example for Altair, it is possible to update a scatterplot based on a selection in ...
bertieb's user avatar
  • 198
1 vote
2 answers
84 views

Solving upside plot and projection problems in Geopandas and Altair

I'm trying to plot a multi-layered map of London using some data from the ONS. import geopandas as gpd from shapely import wkt # Convert the 'geometry' column to shapely geometry objects ...
elksie5000's user avatar
  • 7,580
1 vote
1 answer
33 views

Altair choropleth map doesn't display

I'm trying to create a choropleth from some Kaggle data: https://www.kaggle.com/datasets/jessemostipak/hotel-booking-demand but something isn't working. import pandas as pd import altair as alt from ...
drfqh's user avatar
  • 13

15 30 50 per page
1 2
3
4 5
92