'python How can i change my plotlib figure colors? with numpy

i m using plotlib (for the first time) and there is my graph: enter image description here

But now, i want to change the colors (blue, red and green).

There is my code:

import plotly.graph_objects as px
 
 
x = ['A', 'B', 'C']
 
plot = px.Figure(data=[
    px.Bar( name = '1', x = x, y = [75, 75, 50]),
    px.Bar( name = '2', x = x, y = [75, 75, 50]),
    px.Bar( name = '3', x = x, y = [0, 0, 50] )
])


plot.update_layout(barmode='stack')
                  
plot.show()

I have tried:

px.Bar( name = '1', x = x, y = [75, 75, 50], colors = "red")  or this              color_discrete_sequence =['green'],

and i checked the documentation but it doesnt work and i have everytime the same message

raise err
ValueError: Invalid property specified for object of type plotly.graph_objs.Bar: 'color'

Did you mean "base"?

    Valid properties:
        alignmentgroup
```


Thanks for your help



Solution 1:[1]

I have found an answer on a forum:

i just had to do :

    px.Bar( name = '1', x = x, y = [75, 75, 50], marker_color='#E5EBF7'),

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 guiguilecodeur