1,423 questions
0
votes
0
answers
29
views
Text does not align with bars after using order channel in Altair
I am trying to create a horizontal bar chart that consists of a single bar that represents started and finished activities. The bar should start with the 'started' activities followed by the 'finished'...
3
votes
0
answers
52
views
altair mark_area not working with alt.Y2Value or alt.value
Goal: color the area above the line using mark_area.
Issue: the area appears below the line. Any changes I make to the Y2 channel (in terms of using alt.Y2Value or alt.value) have no effect.
Context: ...
1
vote
0
answers
47
views
altair binned legend label alignment for min and max values
I'm following this example from the documentation:
import altair as alt
from vega_datasets import data
source = data.movies()
alt.Chart(source).mark_bar().encode(
alt.X("IMDB_Rating:Q")...
2
votes
1
answer
103
views
Change color of single line in altair line chart based on other indicator column
Imagine having the following polars dataframe "df" that contains the temperature of a machine that is either "active" or "inactive":
import polars as pl
from datetime ...
1
vote
1
answer
209
views
Altair stacked bar chart in custom order
I've built a dataset in Polars (python), attempting to plot it as a stacked horizontal bar chart using Polars' built-in Altair plot function, however trying to specify a custom sort order for the ...
Advice
4
votes
4
replies
217
views
Ridgeplot with area charts in plotly (or any other free python library)
I'm trying to create a chart, that looks like a Ridgeplot (for examples see this and this), but has smoothed Area charts with a categorical x-axis as a basis.
Why standard Ridgeplot libraries don't ...
0
votes
1
answer
37
views
Problems with `transform_aggregate()` in Vega-Altair
Using the wheat dataset from vega_datasets to build a standard bar chart
from vega_datasets import data
alt.Chart(data.wheat()).mark_bar().encode(
alt.X('year:O'),
alt.Y('wheat:Q')
)
I get
...
2
votes
1
answer
80
views
Color areas in an altair plot
I want to create colored areas in a plot to essentially mark a "region". In matplotlib I could achieve this by manipulating barh:
import polars as pl
import matplotlib.pyplot as plt
aux = ...
0
votes
0
answers
63
views
altair plots do not show axis properly
I am trying to recreate altair plots to check my setup and it does not plot the axis ticks and labels. Is there a cached config or settings that I need to clear?
source = pd.DataFrame({
'a': ['A', ...
1
vote
1
answer
86
views
When Altair saves plot with save, it loses some configuration parameters
I made a heatmap with Altair with wide borders between the cells, in Jupyter notebook.
When I print it in notebook it looks like it is supposed to - with wide borders,
However when I save it as png, ...
0
votes
0
answers
90
views
How do I make a mark_rule that stops at a previously defined line?
I've plotted a curve which involved some transform calculations, and now I want to place a vertical rule at a specific x location that stops at the height corresponding to that line.
This is what I'...
1
vote
2
answers
111
views
How can I keep distincts data points with similar X value?
I have a dataframe with 4 rows, two of which having the same value for the "a" field.
I'd like to have a bar chart with 4 bars, one for each row.
Trying with Altair
source = pd.DataFrame({
...
2
votes
1
answer
93
views
altair mark_area() with unexpected behaviour of y2
I'm trying to make an area chart of a CDF plot (which should be always increasing), instead I get the result in the image below.
import altair as alt
import polars as pl
_data = pl.DataFrame({"...
1
vote
1
answer
237
views
Altair fails to render chart out of pandas dataframe on Streamlit
I have the following code in Python, using Streamlit as framework:
try:
native_data = data.copy()
# Create Altair chart with native data
st.write(f"Debug: Native data type: {type(...
2
votes
1
answer
72
views
Altair sorting a layered chart with mark_errorbar doesn't work
I have a layered chart (see below). I want to sort its X axis by values of the Y axis. When my layered chart consist of bars + mark_rule, the sorting works. However, when I replace mark_rule with ...
