In the below example, I create an bar plot, with the height and the color of the bars both encoding the y column of df. The bars then appear in different shades, for very light to very dark; in blue.
import altair as alt
import numpy as np
import polars as pl
N = 20
df = pl.DataFrame({
'x': range(N),
'y': np.random.randint(0, 100, N)
})
alt.Chart(df).mark_bar().encode(x='x', y='y', color='y')
Now, how do tell altair to use the same encoding but apply another color map of my liking, such that the bars are displayed in, e.g. shades of yellow?
Adding color=yellow to mark_bar does not work, as it is overwritten by the subsequent encoding.