Skip to main content

All Questions

Tagged with
0 votes
1 answer
62 views

Using a list of colors for a bar chart in Altair

I am trying to provide a list of colors to bind to the bar marks in Altair, similar to how matplotlib's pyplot.bar(color=list_of_colors) can specify the color for each individual bar, like in the ...
Mohit Chawla's user avatar
1 vote
1 answer
27 views

Bars not extending the full size in Vega/Altair plot

I'm trying to plot a histogram from pre-binned data using Vega-lite (Actually, Altair in Python, but I got the issue when using Vega directly as well). My dataset contains the following fields: bin: ...
hemagso's user avatar
  • 41
2 votes
1 answer
52 views

Concatenate two geoshape charts in Altair / Vega-Lite with independent axis?

I am trying to plot two separate geoshape charts and concatenate them together. Below is a MWE of what I am trying to do: import altair as alt from vega_datasets import data import geopandas as gpd ...
kgoodrick's user avatar
  • 501
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
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
0 answers
39 views

chart objects not showing on the chart using selection containing fields with converted columns from datetime data

I am using Altair to create visualisations based on a local csv file about WW1 bombing incidents.nI tried to make 2 charts: one shows all incidents in the same month, one shows all incidents in the ...
Terry563's user avatar
3 votes
3 answers
380 views

Enable x-zoom in altair chart

I'd like to be able to zoom into my time series in altair. I understand that this is currently still work in progress, but I hoped to be able to circumvent this restriction by the following idea ...
Thomas's user avatar
  • 1,089
1 vote
0 answers
34 views

Altair chart inside a (panel) Flexbox with "container" width

I'm trying to put some Altair charts inside a flexbox, having the width of the charts adjust to the available space. I'm using Panel to set up the flexbox, like this: import panel as pn import altair ...
Bert Coerver's user avatar
1 vote
1 answer
62 views

Sorting an Altair Ridgeline Plot

Here is an example of an Altair Ridgeline Plot. Source:Altair Gallery. How do I sort the ridgeline plot by the max height or area of each ridge in descending order? Is that possible? I want to show ...
Stephanie's user avatar
-1 votes
2 answers
428 views

Altair: How to format times in axis labels in a non-UTC non-local timezone?

I'm trying to plot some time series data with Altair, and have the times (on the axis labels) show up in a fixed timezone that's not UTC and not the user's local timezone. As far as I can tell from ...
aviraldg's user avatar
  • 9,124
1 vote
1 answer
133 views

How to draw a diagonal line with mark_rule that stretches to infinity in Altair

I want to draw a diagonal line in Altair that goes on forever (e.g. an identity line where x=y). I drew a line between two points (xmin, ymin) and (xmax, ymax) using mark_rulelike this: x1, x2 = alt....
Antonia H's user avatar
1 vote
0 answers
27 views

Open urls from a mark_text() data table that was filtered based on chart selections

I'm trying to display a table of url values based on interactive selections. I am able to display it, following the example on the docs, but I want to be able to click on one of the urls in the table ...
oth_the_rocks's user avatar
1 vote
1 answer
71 views

Altair - plot on background image

I would like to display an image and plot markers on it. However, the image does not appear to align with the axis well, resulting in the markers in wrong places. Here is my code: import altair as alt ...
Tu Bui's user avatar
  • 1,692
0 votes
0 answers
42 views

Python Altair Display only some labels and ticks at x-axis

i have a data frame with dates and values. On x-axis I just want to display the labels and ticks for specific months, e.g. if month = october. Here is a sample code: import pandas as pd from datetime ...
David Salzmann's user avatar

15 30 50 per page
1
2 3 4 5
18