All Questions
1,014
questions
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 ...
3
votes
1
answer
56
views
Altair Barchart is blank, matplotlib equivalent shows correct visualization
I have been using altair for a time and this is the first time that I have experienced this issue, I have this simple code:
import pandas as pd
import altair as alt
# extract data into a nested list
...
0
votes
2
answers
36
views
Remove gap between two graphs with shared axis
Objective
I want to generate a 'double ended' barchart, showing gained points (of some metric) vis-a-vis missed points, something like this:
Result so far
I managed to do this
import altair as alt
...
1
vote
2
answers
43
views
Altair chart legend for subset of data
As an exercise for learning more advanced altair, I'm trying to generate a simplified version of this chart: https://climatereanalyzer.org/clim/t2_daily/?dm_id=world.
To simplify, I'm using gray for ...
1
vote
1
answer
21
views
Inconsistent graphs with Altair despite same package version
I am working on creating graphs using Altair in different environments with different package sets. Despite ensuring the Altair version is consistent across these environments, I am observing ...
1
vote
0
answers
36
views
Python: ImportError: DLL load failed while importing lib: The specified procedure could not be found
python programming newbie here. I was trying to create a simple histogram with altair using the following code. The dataset is large, around 1,000 rows.
count_chart = alt.Chart(df).mark_bar().encode(
...
0
votes
0
answers
36
views
Wrong rectangle width in altair chart for pandas dataframe
I have pandas dataframe which stores currency rate for given day.
print(df[['Date', 'Currency', 'Rate']].head())
Date Currency Rate
18 2023-12-01 AUD 1.64655
19 2023-12-01 BRL ...
1
vote
1
answer
45
views
Altair: add a line in a grouped bar chart
I have this data that I want to plot. In column 'IPVA' there are [0, 1, 2] as possible values, where 1 and 0 are the data that I want to plot as a grouped bar chart, and the 2 is data that I want to ...
2
votes
1
answer
33
views
Altair not displaying data when changing option on dropdown selector
I want to display counts of a certain feature according to the year with an Altair Chart and I want to do it by selecting year as an option of a dropdown selector. It works fine with the 'None' option ...
1
vote
1
answer
33
views
Clamping Daily Temperature Plot with Altair on Colab
I'm trying to use altair to recreate the world temperature plot from Climate Reanalyzer: https://climatereanalyzer.org/clim/t2_daily/?dm_id=world. The data is pretty easy to load:
import pandas as pd
...
1
vote
1
answer
23
views
Altair Show Axis Tick Labels As Percentage Point
I would like to format axis tick labels as percentage point.
import altair as alt
from vega_datasets import data
source = data.jobs.url
alt.Chart(source).mark_line().encode(
alt.X('year:O'),
...
1
vote
1
answer
28
views
Altair chart empty by dropdown when other chart is displayed
I want to have two different charts, where in the first I can choose an artist in a legend and in the second chart I want to have a dropdown, that filters a year. In my database I have artists, sales ...
1
vote
1
answer
37
views
Remove gaps with xOffset
Is there a way to not have gaps at non-existing data when using x/yOffset? In the example below, category B only has 1 group (x) and I would like that bar to be centered at the B-tick.
source = pd....
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: ...
0
votes
1
answer
33
views
Reorder a stacked barplot in altair
So I am making an interactive plot (which is why I'm using altair) and I want to reorder the stacks within each bar to match the legend. I've tried reodering the df, I've tried using the 'sort' ...