Make_subplots / .add_trace(go.Box / with a categorical x and numerical y / how to get different color for the y category?

# ['ApparentMagnitude', 'RelativeLuminosity', 'RelativeRadius', 'Temperature']
# plotly setup
plot_rows=2
plot_cols=2
fig = make_subplots(rows=plot_rows, cols=plot_cols,  subplot_titles=(num_cols))

# creating all the plots
x = 0
for i in range(1, plot_rows + 1):
    for j in range(1, plot_cols + 1):
        #print(str(i)+ ', ' + str(j))
        fig.add_trace(go.Box(x=df['Type'].values,
                             y=df[num_cols][df[num_cols].columns[x]].values,
                             name = df[num_cols].columns[x],
                            ),
                      row=i,
                      col=j)
        x=x+1

# Format and show fig
fig.update_layout(height=800, 
                  width=1000, 
                  template= 'ggplot2',
                  title_text="Numericals vs Type",
                  font=dict(
                      family="Arial",
                      size=12,
                      color='#000000'
                  )
                 )

fig.show()

output the following figure:

**I want to get different colors for each category of my y:

  • Red Dwarf - boxplot should be RED
  • Brown Dwarf - boxplot should be BROWN
  • White Dwarf - boxplot should be IVORY
  • Main Sequence - boxplot should be GREEN
  • Super Giants - boxplot should be BLUE
  • Hyper Giants - boxplot should be ORANGE

How can I change the color?
**

You can assign a different color to each box only by defining a separate trace for each one, and setting marker_color=β€œred”, etc. The marker_color does not accept a list of colors [β€œred”, β€œblue”, β€œmagenta”]: https://plotly.com/python/reference/box/#box-marker-color.
In your subplots the box color is picked up from the ggplot2 colorway.