i'm trying to change the color of my charts with a Hex code . this is my code
Uniq=["Seattle","New York"]
select = alt.selection_single(
name='Select', # name the selection 'Select'
fields=["location"], # limit selection to the Major_Genre field
init={"location": Uniq[1]}, # use first genre entry as initial value
bind=alt.binding_select(options=Uniq) # bind to a menu of unique genre values
)
alt.Chart(weather).mark_point(filled=True, size=15, opacity=0.5).add_selection(
select).encode(
alt.X(alt.repeat('column'), type='quantitative'),
alt.Y(alt.repeat('row'), type='quantitative'),
#alt.Color(scale=alt.Scale(domain=[0,10,20,30,40,50],range=["#ffffff","#bdd7e7","#6baed6","#3182bd","#08519c"])'#f4a582'),
color= alt.Color(alt.value("#f4a582")),
opacity=alt.condition(select, alt.value(0.75), alt.value(0.05))
).properties(
width=125,
height=125
).repeat(
row=['temp_max', 'precipitation', 'wind'],
column=['wind', 'precipitation', 'temp_max']
)
this is the error that i get.
Invalid specification altair.vegalite.v4.schema.channels.Color, validating 'required' 'type' is a required property
howcan i change the color when using Repeat. tnx
I think what you want is this:
color=alt.value("#f4a582")